120242024-11-25 14:43:21mártonágnesHőségriadó (50 pont)cpp17Wrong answer 2/501ms508 KiB
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int L, K, F, dbn=0, dbk=0, dbhr=0;
    long N;
    ifstream fin("be2.txt");
    fin >>N>>K>>L>>F;
    int A[N];
    for (int i=0; i<=N-1; i++)
        fin >>A[i];
    for (int j=0; j<=N-1; j++)
    {
        if (A[j]>F)
        {
            dbn++;
            dbk=0;
            if (dbn==K)
            {
                dbhr++;
            }

        }
        else if (A[j]<F && dbn>=K)
        {
            dbk++;
            if (dbk==L)
            {
                dbn=0;
            }
        }
    }
    cout << dbhr;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Wrong answer0/21ms320 KiB
4Wrong answer0/21ms508 KiB
5Wrong answer0/21ms320 KiB
6Accepted2/21ms320 KiB
7Wrong answer0/21ms500 KiB
8Wrong answer0/41ms332 KiB
9Wrong answer0/41ms320 KiB
10Wrong answer0/41ms320 KiB
11Wrong answer0/41ms320 KiB
12Wrong answer0/41ms500 KiB
13Wrong answer0/41ms320 KiB
14Wrong answer0/41ms320 KiB
15Wrong answer0/41ms500 KiB
16Wrong answer0/41ms320 KiB
17Wrong answer0/41ms320 KiB