132092025-01-07 08:28:09Leventusz09Hőségriadó (50 pont)cpp17Wrong answer 22/5021ms756 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/01ms500 KiB
2Accepted0/021ms708 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms756 KiB
7Accepted2/21ms316 KiB
8Accepted4/41ms316 KiB
9Accepted4/48ms548 KiB
10Wrong answer0/412ms564 KiB
11Wrong answer0/414ms592 KiB
12Wrong answer0/410ms560 KiB
13Wrong answer0/417ms656 KiB
14Wrong answer0/42ms316 KiB
15Wrong answer0/420ms696 KiB
16Wrong answer0/419ms700 KiB
17Accepted4/419ms576 KiB