90362024-02-12 19:45:10matyiVirágos rét (50 pont)cpp17Time limit exceeded 7/50300ms3548 KiB
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    //ifstream fin("be.in");
    int n,k;
    bool a[100001];
    cin>>n>>k;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    int db=0, x=0,j;
    for (int i=1;i<n-k;i++)
    {
        x=0;
        j=i+1;
        while (x!=k and j<=n)
        {
            if (a[j])
                x++;
            j++;
        }
        if (x==k)
            db++;
    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/03ms2100 KiB
2Accepted0/03ms2368 KiB
3Time limit exceeded0/0266ms2304 KiB
4Wrong answer0/23ms2500 KiB
5Accepted2/23ms2780 KiB
6Accepted2/22ms2740 KiB
7Wrong answer0/33ms2996 KiB
8Accepted3/33ms3008 KiB
9Wrong answer0/33ms2984 KiB
10Wrong answer0/23ms3004 KiB
11Wrong answer0/33ms2984 KiB
12Wrong answer0/23ms3236 KiB
13Wrong answer0/33ms3192 KiB
14Wrong answer0/218ms3192 KiB
15Wrong answer0/219ms3472 KiB
16Time limit exceeded0/3300ms2596 KiB
17Time limit exceeded0/3277ms2556 KiB
18Wrong answer0/364ms3400 KiB
19Time limit exceeded0/3261ms2808 KiB
20Time limit exceeded0/3300ms2672 KiB
21Time limit exceeded0/3277ms2672 KiB
22Wrong answer0/319ms3548 KiB