117242024-11-08 09:55:57MrChipserVirágos rét (50 pont)cpp17Wrong answer 42/5018ms748 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k;
    cin >> n >> k;
    int v = 0;
    int sz = 0;
    for(int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        if(a==1)
        {
            v++;
            if(v-k+1>0)
                sz+=v-k+1;
        }
    }
    cout << sz;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted0/018ms568 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms508 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms568 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms320 KiB
14Accepted2/217ms588 KiB
15Wrong answer0/217ms548 KiB
16Accepted3/317ms452 KiB
17Accepted3/317ms592 KiB
18Wrong answer0/317ms568 KiB
19Accepted3/317ms596 KiB
20Accepted3/317ms596 KiB
21Accepted3/317ms568 KiB
22Wrong answer0/317ms748 KiB