83172024-01-14 17:48:04gyjazminVirágos rét (50 pont)cpp17Wrong answer 4/5019ms4024 KiB
#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <numeric>
using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    //vector<int> reteksz;
    int ossz = 0;
    for (int i = 0; i < n; i++) {
        int cv;
        cin >> cv;
        if (cv == 1) {
            ossz++;
            //reteksz.push_back(i + 1);
        }
    }
    int s = ossz - k + 1;
    int vsz = 0;
    if (ossz < k) {
        cout << 0 << endl;
    }
    /*else if (s == 0) {
        cout << 1 << endl;
    }*/
    else {
        for (int i = 1; i < s; i++) {
            vsz += ossz-s-i;
        }
        cout << vsz << endl;
    }
}

SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/03ms1876 KiB
2Accepted0/03ms2116 KiB
3Wrong answer0/019ms2332 KiB
4Wrong answer0/23ms2648 KiB
5Accepted2/23ms2672 KiB
6Accepted2/23ms2740 KiB
7Wrong answer0/33ms2736 KiB
8Wrong answer0/33ms2872 KiB
9Wrong answer0/33ms2832 KiB
10Wrong answer0/23ms3080 KiB
11Wrong answer0/33ms3296 KiB
12Wrong answer0/23ms3528 KiB
13Wrong answer0/33ms3704 KiB
14Wrong answer0/217ms3584 KiB
15Wrong answer0/218ms3840 KiB
16Wrong answer0/319ms3828 KiB
17Wrong answer0/318ms3716 KiB
18Wrong answer0/319ms3712 KiB
19Wrong answer0/319ms3812 KiB
20Wrong answer0/319ms3896 KiB
21Wrong answer0/319ms4016 KiB
22Wrong answer0/319ms4024 KiB