120332024-11-25 15:50:47mártonágnesVirágos rét (50 pont)cpp17Wrong answer 4/50300ms704 KiB
#include <iostream>

using namespace std;

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

    }
    cout << fele;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/01ms320 KiB
2Accepted0/01ms320 KiB
3Time limit exceeded0/0282ms704 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Wrong answer0/31ms320 KiB
8Wrong answer0/31ms512 KiB
9Wrong answer0/31ms508 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/32ms508 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/31ms320 KiB
14Time limit exceeded0/2298ms636 KiB
15Time limit exceeded0/2300ms568 KiB
16Time limit exceeded0/3300ms596 KiB
17Time limit exceeded0/3282ms592 KiB
18Time limit exceeded0/3289ms612 KiB
19Wrong answer0/375ms568 KiB
20Time limit exceeded0/3289ms572 KiB
21Time limit exceeded0/3287ms680 KiB
22Time limit exceeded0/3282ms572 KiB