84662024-01-16 21:40:21zoliVirágos rét (50 pont)cpp17Wrong answer 42/5020ms3492 KiB
#include <iostream>

using namespace std;
int N, K;
int db1=0; //1-ek szama
long long ered=0;
void be()
{
    cin>>N>>K;
    short x=0;
    for(int i=1;i<=N;i++)
    {
        cin>>x;
        if(x==1)db1++;
        //db1+=x;
    }
}

int main()
{
    be();
    if(db1>=K) ered=(db1-K+1)*(db1-K+2)/2;
    cout<<ered;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/03ms1748 KiB
2Accepted0/03ms1992 KiB
3Accepted0/019ms2204 KiB
4Accepted2/23ms2412 KiB
5Accepted2/23ms2420 KiB
6Accepted2/23ms2548 KiB
7Accepted3/33ms2760 KiB
8Accepted3/33ms3008 KiB
9Accepted3/33ms3216 KiB
10Accepted2/23ms3268 KiB
11Accepted3/33ms3268 KiB
12Accepted2/23ms3264 KiB
13Accepted3/33ms3268 KiB
14Accepted2/217ms3264 KiB
15Wrong answer0/218ms3284 KiB
16Accepted3/319ms3268 KiB
17Accepted3/320ms3408 KiB
18Wrong answer0/319ms3364 KiB
19Accepted3/319ms3360 KiB
20Accepted3/319ms3388 KiB
21Accepted3/319ms3372 KiB
22Wrong answer0/318ms3492 KiB