83802024-01-15 11:09:47antiVirágos rét (50 pont)cpp14Wrong answer 38/5019ms4136 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/03ms2156 KiB
2Accepted0/03ms2280 KiB
3Accepted0/019ms2288 KiB
4Accepted2/22ms2284 KiB
5Wrong answer0/23ms2320 KiB
6Wrong answer0/23ms2536 KiB
7Accepted3/32ms2596 KiB
8Accepted3/33ms2728 KiB
9Accepted3/33ms2880 KiB
10Accepted2/23ms2864 KiB
11Accepted3/33ms2928 KiB
12Accepted2/23ms3140 KiB
13Accepted3/33ms3384 KiB
14Accepted2/217ms3368 KiB
15Wrong answer0/218ms3364 KiB
16Accepted3/319ms3504 KiB
17Accepted3/318ms3584 KiB
18Wrong answer0/319ms3616 KiB
19Accepted3/319ms3716 KiB
20Accepted3/319ms3964 KiB
21Accepted3/319ms4012 KiB
22Wrong answer0/318ms4136 KiB