124622024-12-18 09:44:26feheristvanHőségriadó (50 pont)cpp17Wrong answer 18/5021ms508 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, k, l, f;
    cin >> n >> k >> l >> f;
    int folotte = 0, alatta = 0, x;
    int hosegriado = 0;
    bool hoseg = false;
    for(int i = 0; i < n; i ++){
        cin >> x;
        if(x > f){
            alatta = 0;
            folotte ++;
        }

        else if(x < f){
            alatta ++;
            folotte = 0;
        }
        if(alatta == l){
            folotte = 0;
            alatta = 0;
            hoseg = false;
        }
        if(folotte == k && !hoseg){
            hosegriado ++;
            hoseg = true;
        }
    }
    cout << hosegriado;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/01ms508 KiB
2Wrong answer0/021ms320 KiB
3Accepted2/21ms500 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms320 KiB
7Accepted2/21ms508 KiB
8Accepted4/42ms320 KiB
9Accepted4/49ms320 KiB
10Wrong answer0/412ms408 KiB
11Wrong answer0/414ms400 KiB
12Wrong answer0/412ms400 KiB
13Wrong answer0/417ms408 KiB
14Wrong answer0/43ms320 KiB
15Wrong answer0/420ms404 KiB
16Wrong answer0/420ms508 KiB
17Wrong answer0/420ms400 KiB