132492025-01-07 10:51:38Leventusz09Hőségriadó (50 pont)cpp17Wrong answer 22/5020ms512 KiB
#include <iostream>
#include <vector>

using namespace std;



int main(){
    int N, K, L, F;
    cin >> N >> K >> L >> F;

    int g = 0,
        l = 0,
        o = 0;

    bool n = 0;

    for(int i=0, c; i<N; i++){
        cin >> c;
        if(c > F) g++;
        else g = 0;

        if(c < F) l++;
        else l = 0;

        if(g >= K && !n){
            o++;
            n = 1;
        }
        if(l >= K && n){
            n = 0;
        }
    }
    cout << o << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Accepted0/01ms316 KiB
2Accepted0/020ms316 KiB
3Accepted2/21ms512 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Accepted2/21ms508 KiB
8Accepted4/41ms316 KiB
9Accepted4/48ms384 KiB
10Wrong answer0/410ms316 KiB
11Wrong answer0/413ms396 KiB
12Wrong answer0/410ms316 KiB
13Wrong answer0/417ms396 KiB
14Wrong answer0/42ms320 KiB
15Wrong answer0/419ms392 KiB
16Wrong answer0/419ms500 KiB
17Accepted4/419ms404 KiB