Submission #9529435
Source Code Expand
N = int(input()) A = [0] A.extend(list(map(int, input().split()))) A.append(0) sumA = 0 for i in range(len(A)-1): sumA += abs(A[i + 1] - A[i]) for i in range(1,N+1): print(sumA - 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 | pppppowell |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 274 Byte |
Status | AC |
Exec Time | 228 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 | 210 ms | 14044 KB |
02.txt | AC | 213 ms | 13784 KB |
03.txt | AC | 17 ms | 3064 KB |
04.txt | AC | 212 ms | 13792 KB |
05.txt | AC | 212 ms | 13920 KB |
06.txt | AC | 208 ms | 14048 KB |
07.txt | AC | 221 ms | 13920 KB |
08.txt | AC | 220 ms | 13792 KB |
09.txt | AC | 206 ms | 11784 KB |
10.txt | AC | 208 ms | 11908 KB |
11.txt | AC | 228 ms | 11660 KB |
12.txt | AC | 198 ms | 11920 KB |
sample-01.txt | AC | 17 ms | 3060 KB |
sample-02.txt | AC | 17 ms | 3064 KB |
sample-03.txt | AC | 17 ms | 3064 KB |