118642024-11-12 22:33:45turierikVirágos rét (50 pont)python3Time limit exceeded 25/50300ms5060 KiB
n, k = map(int, input().split())
r = [int(x) for x in input().split()]
x = 0
for i in range(n):
    if r[i] == 0: continue
    y = 0
    for j in range(i, n):
        if r[j] == 1:
            y += 1
            if y >= k:
                x += 1
print(x)
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/016ms2876 KiB
2Accepted0/016ms3116 KiB
3Time limit exceeded0/0289ms4868 KiB
4Accepted2/216ms3064 KiB
5Accepted2/214ms3088 KiB
6Accepted2/214ms3088 KiB
7Accepted3/316ms2884 KiB
8Accepted3/314ms3100 KiB
9Accepted3/314ms2884 KiB
10Accepted2/216ms2876 KiB
11Accepted3/3136ms3188 KiB
12Accepted2/265ms3140 KiB
13Accepted3/339ms3140 KiB
14Time limit exceeded0/2280ms4672 KiB
15Time limit exceeded0/2300ms4664 KiB
16Time limit exceeded0/3272ms5060 KiB
17Time limit exceeded0/3300ms4508 KiB
18Time limit exceeded0/3282ms4980 KiB
19Time limit exceeded0/3300ms4984 KiB
20Time limit exceeded0/3284ms4896 KiB
21Time limit exceeded0/3300ms4928 KiB
22Time limit exceeded0/3284ms4980 KiB