Submission #3600561
Source Code Expand
N,K = map(int,input().split()) x = list(map(int,input().split())) result = [] for i in range(N-K+1): s,g = i,i+K-1 result.append(abs(x[s]) + abs(x[s] - x[g])) result.append(abs(x[g]) + abs(x[g] - x[s])) result.sort() print(result[0])
Submission Info
Submission Time | |
---|---|
Task | C - Candles |
User | tbistr |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 255 Byte |
Status | AC |
Exec Time | 103 ms |
Memory | 14252 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 17 ms | 3060 KB |
0_01.txt | AC | 17 ms | 3064 KB |
0_02.txt | AC | 17 ms | 3060 KB |
0_03.txt | AC | 17 ms | 3064 KB |
1_00.txt | AC | 42 ms | 14172 KB |
1_01.txt | AC | 103 ms | 14172 KB |
1_02.txt | AC | 43 ms | 14252 KB |
1_03.txt | AC | 98 ms | 14100 KB |
1_04.txt | AC | 42 ms | 14000 KB |
1_05.txt | AC | 95 ms | 14000 KB |
1_06.txt | AC | 82 ms | 13944 KB |
1_07.txt | AC | 83 ms | 13976 KB |