120312024-11-25 15:49:07KissCsongor777Virágos rét (50 pont)cpp17Time limit exceeded 28/50300ms520 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/0282ms492 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms320 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms320 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms320 KiB
14Time limit exceeded0/2298ms420 KiB
15Time limit exceeded0/2298ms320 KiB
16Time limit exceeded0/3300ms320 KiB
17Time limit exceeded0/3286ms320 KiB
18Time limit exceeded0/3291ms520 KiB
19Accepted3/3103ms320 KiB
20Time limit exceeded0/3293ms448 KiB
21Time limit exceeded0/3282ms320 KiB
22Time limit exceeded0/3282ms320 KiB