Submission #3600859
Source Code Expand
nk = list(map(int, input().split())) n = nk[0] k = nk[1] x = list(map(int, input().split())) min_d = 10 ** 9 for i in range(n - k + 1): max_i = x[i + k - 1] min_i = x[i] if max_i <= 0: min_d_i = - min_i elif min_i >= 0: min_d_i = max_i else: min_d_i = min(- min_i + 2 * max_i, -2 * min_i + max_i) if min_d_i < min_d: min_d = min_d_i print(min_d)
Submission Info
Submission Time | |
---|---|
Task | C - Candles |
User | mory |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 423 Byte |
Status | AC |
Exec Time | 79 ms |
Memory | 14228 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 | 3064 KB |
0_01.txt | AC | 17 ms | 3060 KB |
0_02.txt | AC | 17 ms | 3060 KB |
0_03.txt | AC | 17 ms | 3064 KB |
1_00.txt | AC | 42 ms | 13984 KB |
1_01.txt | AC | 79 ms | 13984 KB |
1_02.txt | AC | 42 ms | 14224 KB |
1_03.txt | AC | 63 ms | 14228 KB |
1_04.txt | AC | 41 ms | 14092 KB |
1_05.txt | AC | 61 ms | 14092 KB |
1_06.txt | AC | 65 ms | 13944 KB |
1_07.txt | AC | 68 ms | 13976 KB |