188042025-11-05 08:17:49birozsÚthasználati díj (75 pont)python3Time limit exceeded 50/75300ms4960 KiB
N,K = map(int,input().split())
T = list(map(int,input().split()))
ossz = 0
for i in range(N-1):
    if T[i] == 1:
        j = i + 1
        db = 1
        while j < N and db < K:
            if T[j] == 1:
                db += 1
                ossz += 1
            j += 1
print(ossz)

SubtaskSumTestVerdictTimeMemory
base50/75
1Accepted0/014ms2868 KiB
2Accepted0/014ms2884 KiB
3Time limit exceeded0/0277ms4960 KiB
4Accepted5/516ms2868 KiB
5Accepted5/516ms2868 KiB
6Accepted5/514ms2868 KiB
7Accepted5/516ms2868 KiB
8Accepted5/514ms2868 KiB
9Accepted5/517ms2860 KiB
10Accepted5/520ms3136 KiB
11Accepted5/516ms2868 KiB
12Accepted5/532ms3096 KiB
13Accepted5/548ms3084 KiB
14Time limit exceeded0/5256ms4960 KiB
15Time limit exceeded0/5287ms4960 KiB
16Time limit exceeded0/5300ms4960 KiB
17Time limit exceeded0/5282ms4960 KiB
18Time limit exceeded0/5287ms4960 KiB