Submission #3237597
Source Code Expand
N = int(input()) A = list(map(int, input().split())) def a(i): if 0 <= i < N: return A[i] else: return 0 base = 0 for i in range(N + 1): base += abs(a(i) - a(i - 1)) for i in range(N): print(base - abs(a(i) - a(i - 1)) - abs(a(i + 1) - a(i)) + abs(a(i + 1) - a(i - 1)))
Submission Info
Submission Time | |
---|---|
Task | C - Traveling Plan |
User | shirodoni |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 318 Byte |
Status | AC |
Exec Time | 324 ms |
Memory | 14048 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 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 | AC | 304 ms | 13912 KB |
02.txt | AC | 324 ms | 14040 KB |
03.txt | AC | 17 ms | 3064 KB |
04.txt | AC | 316 ms | 13920 KB |
05.txt | AC | 310 ms | 14048 KB |
06.txt | AC | 310 ms | 14048 KB |
07.txt | AC | 308 ms | 13792 KB |
08.txt | AC | 302 ms | 13920 KB |
09.txt | AC | 309 ms | 11784 KB |
10.txt | AC | 311 ms | 11908 KB |
11.txt | AC | 305 ms | 11668 KB |
12.txt | AC | 290 ms | 11916 KB |
sample-01.txt | AC | 17 ms | 3064 KB |
sample-02.txt | AC | 17 ms | 3060 KB |
sample-03.txt | AC | 17 ms | 3060 KB |