Submission #3600836
Source Code Expand
n, k = map(int,input().split()) x = list(map(int,input().split())) time = 10**9 for i in range(n - k + 1): x_k = x[i:i+k] #print(x_k) if x_k[0] >= 0: t = x_k[-1] elif x_k[-1] <= 0: t = -x_k[0] elif -x_k[0] <= x_k[-1]: t = -x_k[0] * 2 + x_k[-1] else: t = -x_k[0] + x_k[-1] *2 time = min(t, time) print(time)
Submission Info
Submission Time | |
---|---|
Task | C - Candles |
User | mory |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 425 Byte |
Status | TLE |
Exec Time | 2104 ms |
Memory | 14568 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 18 ms | 3060 KB |
0_01.txt | AC | 18 ms | 3064 KB |
0_02.txt | AC | 18 ms | 3060 KB |
0_03.txt | AC | 18 ms | 3064 KB |
1_00.txt | AC | 46 ms | 13984 KB |
1_01.txt | TLE | 2104 ms | 13984 KB |
1_02.txt | AC | 46 ms | 14224 KB |
1_03.txt | TLE | 2104 ms | 14224 KB |
1_04.txt | AC | 46 ms | 14004 KB |
1_05.txt | TLE | 2104 ms | 14384 KB |
1_06.txt | TLE | 2104 ms | 13944 KB |
1_07.txt | TLE | 2104 ms | 14568 KB |