120282024-11-25 15:14:55KissCsongor777Virágos rét (50 pont)cpp17Time limit exceeded 28/50298ms508 KiB
#include <iostream>

using namespace std;

int main()
{
    int N,K,n,db=0;
    cin>>N>>K;
    bool A[N+1];
    for(int i=1; i<=N; i++)cin>>A[i];
    for(int i=1; i<=N; i++)
    {
        if(A[i])
        {
           n=1;
           for(int k=i+1; k<=N; k++)
           {
               if(A[k]){n++;
               if(n>=K)db++;}
           }

        }


    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base28/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Time limit exceeded0/0282ms508 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms320 KiB
10Accepted2/21ms320 KiB
11Accepted3/32ms320 KiB
12Accepted2/22ms320 KiB
13Accepted3/32ms320 KiB
14Time limit exceeded0/2298ms432 KiB
15Time limit exceeded0/2298ms428 KiB
16Time limit exceeded0/3298ms424 KiB
17Time limit exceeded0/3287ms320 KiB
18Time limit exceeded0/3284ms448 KiB
19Accepted3/3103ms476 KiB
20Time limit exceeded0/3284ms500 KiB
21Time limit exceeded0/3280ms320 KiB
22Time limit exceeded0/3279ms320 KiB