120252024-11-25 14:51:50KissCsongor777Hőségriadó (50 pont)cpp17Accepted 50/5021ms552 KiB
#include <iostream>

using namespace std;

int main()
{
    int N,K,L,F,A,k=0,l=0, db=0;
    cin>>N>>K>>L>>F;
    bool riado=false;
    for(int i=1; i<=N; i++)
    {
        cin>>A;
        if(A>F){k++;l=0;}
        if(A<F){l++; k=0;}
        if(A==F){l=0;k=0;}
        if(k==K && !riado){riado=true; db++;}
        if(l==L) riado=false;
    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/01ms320 KiB
2Accepted0/021ms400 KiB
3Accepted2/21ms320 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted2/21ms320 KiB
8Accepted4/41ms320 KiB
9Accepted4/48ms404 KiB
10Accepted4/412ms404 KiB
11Accepted4/414ms552 KiB
12Accepted4/410ms408 KiB
13Accepted4/417ms400 KiB
14Accepted4/42ms408 KiB
15Accepted4/420ms404 KiB
16Accepted4/420ms552 KiB
17Accepted4/420ms400 KiB