83822024-01-15 11:16:16antiVirágos rét (50 pont)cpp14Wrong answer 38/5019ms4124 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int hany = 0;
    for(int i=0; i<n; i++){
        int h;
        cin >> h;
        if(h==1){
            hany++;
        }
    }
    long long int h = (hany-k+1)*(hany-k+2)/2;
    cout << h;
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/03ms1876 KiB
2Accepted0/03ms2120 KiB
3Accepted0/019ms2332 KiB
4Accepted2/23ms2528 KiB
5Wrong answer0/22ms2604 KiB
6Wrong answer0/23ms2736 KiB
7Accepted3/33ms2820 KiB
8Accepted3/33ms2944 KiB
9Accepted3/33ms2996 KiB
10Accepted2/23ms2996 KiB
11Accepted3/33ms3120 KiB
12Accepted2/23ms3128 KiB
13Accepted3/33ms3488 KiB
14Accepted2/217ms3556 KiB
15Wrong answer0/218ms3572 KiB
16Accepted3/319ms3572 KiB
17Accepted3/318ms3780 KiB
18Wrong answer0/319ms3908 KiB
19Accepted3/318ms3908 KiB
20Accepted3/318ms3880 KiB
21Accepted3/319ms4124 KiB
22Wrong answer0/318ms4096 KiB