Submission #2863856
Source Code Expand
using System; using System.Linq; using System.Collections.Generic; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); int[] x = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); int[] a = new int[n + 2]; a[0] = 0; for(int i = 1; i <= n; i++) { a[i] = x[i - 1]; } a[n + 1] = 0; for (int i = 1; i <= n; i++) { int ans = 0; int pos = 0; for(int j = 1; j <= n + 1; j++) { if(i != j) { ans += Math.Abs(a[pos] - a[j]); pos = j; } } Console.WriteLine(ans); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Traveling Plan |
User | hmakita |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 798 Byte |
Status | TLE |
Exec Time | 2108 ms |
Memory | 19808 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | TLE | 2108 ms | 17760 KB |
02.txt | TLE | 2108 ms | 17632 KB |
03.txt | AC | 25 ms | 13268 KB |
04.txt | TLE | 2108 ms | 15712 KB |
05.txt | TLE | 2108 ms | 17760 KB |
06.txt | TLE | 2108 ms | 15712 KB |
07.txt | TLE | 2108 ms | 17760 KB |
08.txt | TLE | 2108 ms | 19808 KB |
09.txt | TLE | 2108 ms | 15200 KB |
10.txt | TLE | 2108 ms | 17248 KB |
11.txt | TLE | 2108 ms | 17248 KB |
12.txt | TLE | 2108 ms | 17248 KB |
sample-01.txt | AC | 24 ms | 11348 KB |
sample-02.txt | AC | 25 ms | 11220 KB |
sample-03.txt | AC | 24 ms | 11220 KB |