120322024-11-25 15:49:30KissCsongor777Virágos rét (50 pont)cpp17Wrong answer 42/5018ms508 KiB
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int N,K,n=0;
    cin>>N>>K;
    bool x;
    for(int i=1; i<=N; i++)
    {
        cin>>x;
        if(x)n++;
    }
    if(n>=K)
    cout<<(n-K+1)*(n-K+2)/2;
    else cout<<0;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted0/018ms508 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms320 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms320 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms392 KiB
14Accepted2/217ms400 KiB
15Wrong answer0/217ms404 KiB
16Accepted3/318ms404 KiB
17Accepted3/317ms400 KiB
18Wrong answer0/318ms404 KiB
19Accepted3/318ms500 KiB
20Accepted3/318ms404 KiB
21Accepted3/318ms400 KiB
22Wrong answer0/317ms408 KiB