120212024-11-25 14:39:52ruffbrigiVirágos rét (50 pont)cpp17Wrong answer 46/5018ms1172 KiB
#include <iostream>

using namespace std;

int main()
{
    long long n,k,db1=0;
    cin>>n;
    cin>>k;
    long long a[n];
    for(long long i=0;i<=n-1;i++)
    {
        cin>>a[i];
    }
    for(long long i=0;i<=n-1;i++)
    {
        if(a[i]==1) db1++;
    }
    long long x=(db1-k+1)*(db1-k+2)/2;
    cout<<x;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base46/50
1Accepted0/01ms512 KiB
2Accepted0/01ms320 KiB
3Accepted0/018ms1080 KiB
4Accepted2/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms508 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms320 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms404 KiB
14Accepted2/217ms1072 KiB
15Accepted2/217ms912 KiB
16Accepted3/318ms912 KiB
17Accepted3/317ms1064 KiB
18Accepted3/318ms1080 KiB
19Accepted3/317ms1072 KiB
20Accepted3/318ms1012 KiB
21Accepted3/318ms1172 KiB
22Accepted3/317ms1132 KiB