144302025-01-10 18:35:26duongtamas01Virágos rét (50 pont)cpp17Wrong answer 9/5018ms796 KiB
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int k;
    cin >> k;
    vector < int > t(n);
    int egyesek = 0;

    for(int i = 0; i < n; i++){
        cin >> t[i];
        if(t[i] == 1){
            egyesek++;
        }
    }
    long long ans = 0;
    if(egyesek >= k){
        ans = 1;
    }
    for(int i = k - 1; i < egyesek - 1; i++){
        ans += i;
    }
    cout << ans;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Wrong answer0/018ms760 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms332 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/31ms316 KiB
8Accepted3/31ms512 KiB
9Wrong answer0/32ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/31ms508 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/31ms316 KiB
14Accepted2/217ms564 KiB
15Wrong answer0/217ms564 KiB
16Wrong answer0/318ms796 KiB
17Wrong answer0/317ms564 KiB
18Wrong answer0/318ms568 KiB
19Wrong answer0/318ms564 KiB
20Wrong answer0/318ms748 KiB
21Wrong answer0/318ms568 KiB
22Wrong answer0/317ms564 KiB