82442024-01-13 20:18:20sangerafKerékpártúra (50 pont)cpp17Wrong answer 0/506ms4368 KiB
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n, k; cin >> n >> k;
    long long db=0;
    long long ans=0;
    for(int i=1; i<=n; i++){
        int x; cin >> x;
        if(x==1){
            db++;
            if(db>=k) ans += db-k+1;
        }
    }
    cout << ans << endl;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/04ms2064 KiB
3Wrong answer0/22ms2152 KiB
4Wrong answer0/23ms2180 KiB
5Wrong answer0/23ms2524 KiB
6Wrong answer0/23ms2604 KiB
7Wrong answer0/23ms2712 KiB
8Wrong answer0/23ms2896 KiB
9Wrong answer0/23ms3088 KiB
10Wrong answer0/23ms3204 KiB
11Wrong answer0/23ms3168 KiB
12Wrong answer0/23ms3420 KiB
13Wrong answer0/23ms3632 KiB
14Wrong answer0/23ms3712 KiB
15Wrong answer0/36ms3964 KiB
16Wrong answer0/44ms3928 KiB
17Wrong answer0/44ms3936 KiB
18Wrong answer0/34ms4020 KiB
19Wrong answer0/34ms4144 KiB
20Wrong answer0/34ms4232 KiB
21Wrong answer0/34ms4240 KiB
22Wrong answer0/34ms4368 KiB