84812024-01-17 15:38:12petergalambosVirágos rét (50 pont)python3Wrong answer 5/5041ms16976 KiB
from sys import stdin

N, K = [int(i) for i in input().split()]
R = [int(i) for i in stdin.readline().split()].count(1)
if R > K:
    print(0)
else:    
    S = (R-K+1)*(R-K+2)//2
    print(S)
SubtaskSumTestVerdictTimeMemory
base5/50
1Wrong answer0/018ms11396 KiB
2Accepted0/017ms11396 KiB
3Wrong answer0/041ms15552 KiB
4Wrong answer0/217ms11976 KiB
5Wrong answer0/217ms12008 KiB
6Wrong answer0/217ms12120 KiB
7Wrong answer0/317ms12508 KiB
8Accepted3/317ms12596 KiB
9Wrong answer0/317ms12596 KiB
10Wrong answer0/217ms12768 KiB
11Wrong answer0/317ms12992 KiB
12Wrong answer0/217ms12600 KiB
13Wrong answer0/317ms12716 KiB
14Accepted2/237ms15832 KiB
15Wrong answer0/239ms16008 KiB
16Wrong answer0/341ms16836 KiB
17Wrong answer0/339ms16032 KiB
18Wrong answer0/341ms16684 KiB
19Wrong answer0/341ms16760 KiB
20Wrong answer0/341ms16888 KiB
21Wrong answer0/341ms16976 KiB
22Wrong answer0/341ms16844 KiB