Submission #4040091


Source Code Expand

N,K = map(int,input().split())
A = list(map(int,input().split()))
B = [0 for i in range(N)]
for i in range(N) :
    if A[i] > 0 :
        try :
            for j in range(i,i+K) :
                B[j] = True
        except IndexError :
            break
    else :
        B[i] = False
ans = 0
for i in range(N) :
    if B[i] :
        ans += A[i]
print(ans)

Submission Info

Submission Time
Task B - Contiguous Repainting
User kawacchu
Language Python (3.4.3)
Score 0
Code Size 376 Byte
Status WA
Exec Time 2104 ms
Memory 14988 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
AC × 12
WA × 3
TLE × 11
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, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt
Case Name Status Exec Time Memory
0_00.txt AC 17 ms 3060 KB
0_01.txt AC 17 ms 3060 KB
0_02.txt AC 17 ms 2940 KB
0_03.txt AC 17 ms 3060 KB
1_00.txt AC 17 ms 3060 KB
1_01.txt AC 17 ms 3060 KB
1_02.txt AC 17 ms 3060 KB
1_03.txt AC 59 ms 4660 KB
1_04.txt AC 122 ms 14028 KB
1_05.txt AC 66 ms 14124 KB
1_06.txt AC 106 ms 14176 KB
1_07.txt AC 100 ms 14008 KB
1_08.txt WA 74 ms 13916 KB
1_09.txt WA 81 ms 14988 KB
1_10.txt WA 1399 ms 14048 KB
1_11.txt TLE 2104 ms 14000 KB
1_12.txt TLE 2104 ms 13828 KB
1_13.txt TLE 2104 ms 14008 KB
1_14.txt TLE 2104 ms 13952 KB
1_15.txt TLE 2104 ms 14172 KB
1_16.txt TLE 2104 ms 14128 KB
1_17.txt TLE 2104 ms 14252 KB
1_18.txt TLE 2104 ms 14212 KB
1_19.txt TLE 2104 ms 13880 KB
1_20.txt TLE 2104 ms 13884 KB
1_21.txt TLE 2104 ms 14128 KB