84822024-01-17 15:39:36petergalambosVirágos rét (50 pont)python3Wrong answer 48/5043ms17072 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 < 2:
    print(0)
else:
    print((R-K+1)*(R-K+2)//2)
SubtaskSumTestVerdictTimeMemory
base48/50
1Accepted0/018ms11296 KiB
2Accepted0/017ms11448 KiB
3Accepted0/041ms15380 KiB
4Accepted2/217ms11792 KiB
5Accepted2/217ms11996 KiB
6Wrong answer0/217ms12008 KiB
7Accepted3/318ms12592 KiB
8Accepted3/317ms12632 KiB
9Accepted3/317ms12708 KiB
10Accepted2/217ms12768 KiB
11Accepted3/317ms12732 KiB
12Accepted2/218ms12876 KiB
13Accepted3/317ms12716 KiB
14Accepted2/239ms16024 KiB
15Accepted2/239ms16040 KiB
16Accepted3/343ms17072 KiB
17Accepted3/341ms16464 KiB
18Accepted3/341ms16904 KiB
19Accepted3/343ms17044 KiB
20Accepted3/341ms17056 KiB
21Accepted3/343ms17064 KiB
22Accepted3/341ms16904 KiB