120052024-11-24 16:04:52ruffbrigiVirágos rét (50 pont)cpp17Wrong answer 38/5018ms788 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,k,db1=0;
    cin>>n;
    cin>>k;
    int a[n];
    for(int i=0;i<=n-1;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<=n-1;i++)
    {
        if(a[i]==1) db1++;
    }
    int x=(db1-k+1)*(db1-k+2)/2;
    cout<<x;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted0/018ms568 KiB
4Accepted2/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms512 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms548 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms596 KiB
14Accepted2/217ms708 KiB
15Wrong answer0/217ms660 KiB
16Accepted3/317ms644 KiB
17Accepted3/317ms628 KiB
18Wrong answer0/318ms568 KiB
19Accepted3/317ms692 KiB
20Accepted3/317ms788 KiB
21Accepted3/318ms764 KiB
22Wrong answer0/317ms572 KiB