144682025-01-10 22:37:32duongtamas01Virágos rét (50 pont)cpp17Wrong answer 9/5018ms808 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/01ms512 KiB
2Accepted0/01ms512 KiB
3Wrong answer0/018ms564 KiB
4Wrong answer0/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Wrong answer0/31ms316 KiB
8Accepted3/31ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/31ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/31ms316 KiB
14Accepted2/217ms784 KiB
15Wrong answer0/217ms792 KiB
16Wrong answer0/318ms788 KiB
17Wrong answer0/317ms564 KiB
18Wrong answer0/318ms568 KiB
19Wrong answer0/317ms808 KiB
20Wrong answer0/318ms564 KiB
21Wrong answer0/318ms648 KiB
22Wrong answer0/318ms564 KiB