120272024-11-25 15:06:31mártonágnesHőségriadó (50 pont)cpp17Wrong answer 8/5021ms644 KiB
#include <iostream>
//#include <fstream>
using namespace std;

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

        }
        else if (A[j]<F)
        {
            dbk++;
            if (dbk==L)
            {
                dbn=0;
                ///riado=false;
            }
        }
        else if (A[j]==F)
            {
                dbn=0;
                dbk=0;
            }
    }
    cout << dbhr;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/01ms512 KiB
2Wrong answer0/021ms568 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms400 KiB
6Wrong answer0/21ms320 KiB
7Accepted2/21ms320 KiB
8Wrong answer0/41ms320 KiB
9Wrong answer0/48ms472 KiB
10Wrong answer0/410ms552 KiB
11Wrong answer0/414ms568 KiB
12Wrong answer0/410ms568 KiB
13Wrong answer0/417ms552 KiB
14Wrong answer0/42ms428 KiB
15Wrong answer0/419ms644 KiB
16Wrong answer0/419ms540 KiB
17Wrong answer0/420ms504 KiB