83772024-01-15 11:05:43antiVirágos rét (50 pont)cpp14Wrong answer 38/5019ms4196 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++;
        }
    }
    cout << (hany-k+1)*(hany-k+2)/2;
}
SubtaskSumTestVerdictTimeMemory
base38/50
1Accepted0/03ms1744 KiB
2Accepted0/03ms1992 KiB
3Accepted0/019ms2240 KiB
4Accepted2/23ms2456 KiB
5Wrong answer0/22ms2420 KiB
6Wrong answer0/23ms2416 KiB
7Accepted3/33ms2692 KiB
8Accepted3/33ms2860 KiB
9Accepted3/33ms2960 KiB
10Accepted2/23ms3048 KiB
11Accepted3/33ms3300 KiB
12Accepted2/23ms3412 KiB
13Accepted3/33ms3484 KiB
14Accepted2/217ms3680 KiB
15Wrong answer0/218ms3740 KiB
16Accepted3/319ms3740 KiB
17Accepted3/318ms3828 KiB
18Wrong answer0/319ms3888 KiB
19Accepted3/319ms4036 KiB
20Accepted3/318ms4072 KiB
21Accepted3/319ms4184 KiB
22Wrong answer0/318ms4196 KiB