136212025-01-08 11:28:52kongopongVirágos rét (50 pont)cpp17Wrong answer 0/5021ms800 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    vector <int> v;
    v.resize(n);
    int db, x;
    for(int i=1; i<=n; i++)
    {
        cin >> x;
        v[i-1]=x;
        if(v[i-1]==1)
            db++;
    }
    int f=db+1-k;
    if(f<=0)
        cout << 0;
    else
    {
        int ossz=0;
        for(int i=1; i<=f; i++)
            ossz=ossz+i;
        cout << ossz;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/04ms316 KiB
2Wrong answer0/04ms316 KiB
3Wrong answer0/020ms564 KiB
4Wrong answer0/24ms316 KiB
5Wrong answer0/24ms396 KiB
6Wrong answer0/24ms316 KiB
7Wrong answer0/34ms396 KiB
8Wrong answer0/34ms512 KiB
9Wrong answer0/34ms500 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/34ms316 KiB
12Wrong answer0/24ms544 KiB
13Wrong answer0/34ms316 KiB
14Wrong answer0/219ms564 KiB
15Wrong answer0/219ms564 KiB
16Wrong answer0/320ms644 KiB
17Wrong answer0/319ms780 KiB
18Wrong answer0/320ms564 KiB
19Wrong answer0/319ms780 KiB
20Wrong answer0/320ms800 KiB
21Wrong answer0/320ms564 KiB
22Wrong answer0/321ms564 KiB