Submission #832370


Source Code Expand

n, k = map(int, raw_input().split())
H = map(int, raw_input().split())

t = 0
cnt = 0
ans = 0
for s in xrange(n):
    while t < n:
        if H[t] == 0 and cnt < k:
            cnt += 1
        elif H[t] == 0:
            break
        t += 1
    ans = max(ans, t-s)
    if H[s] == 0:
        cnt -= 1
print ans

Submission Info

Submission Time
Task C - 有給休暇(Paid Vacation)
User yaketake08
Language Python (2.7.6)
Score 60
Code Size 329 Byte
Status AC
Exec Time 192 ms
Memory 4268 KB

Judge Result

Set Name All
Score / Max Score 60 / 60
Status
AC × 10
Set Name Test Cases
All 1.txt, 10.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt
Case Name Status Exec Time Memory
1.txt AC 173 ms 4152 KB
10.txt AC 176 ms 4268 KB
2.txt AC 192 ms 4264 KB
3.txt AC 132 ms 3796 KB
4.txt AC 131 ms 3784 KB
5.txt AC 129 ms 3664 KB
6.txt AC 148 ms 3920 KB
7.txt AC 169 ms 4156 KB
8.txt AC 137 ms 3916 KB
9.txt AC 170 ms 4040 KB
sample1.txt AC 25 ms 2568 KB
sample2.txt AC 25 ms 2568 KB