86512024-01-24 23:44:19KezdőVirágos rét (50 pont)python3Accepted 50/5043ms17196 KiB
N,K = [int(i) for i in input().split()]
ret = [int(i) for i in input().split()]
e = ret.count(1)

if e < K:
    print(0)
else:
    print((e-K+1)*(e-K+2)//2)
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/017ms11112 KiB
2Accepted0/017ms11372 KiB
3Accepted0/041ms15332 KiB
4Accepted2/217ms11944 KiB
5Accepted2/217ms12060 KiB
6Accepted2/217ms12168 KiB
7Accepted3/317ms12524 KiB
8Accepted3/317ms12648 KiB
9Accepted3/317ms12548 KiB
10Accepted2/217ms12732 KiB
11Accepted3/317ms13128 KiB
12Accepted2/217ms13140 KiB
13Accepted3/317ms12912 KiB
14Accepted2/239ms16392 KiB
15Accepted2/241ms16100 KiB
16Accepted3/341ms17196 KiB
17Accepted3/341ms16304 KiB
18Accepted3/341ms16800 KiB
19Accepted3/341ms16764 KiB
20Accepted3/341ms16764 KiB
21Accepted3/343ms16848 KiB
22Accepted3/339ms16768 KiB