194312025-12-09 10:37:48DhaneHaneHőségriadó (50 pont)cpp17Wrong answer 18/5021ms1120 KiB
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n,k,l,f; cin>>n>>k>>l>>f;
    vector<int> ho(n+1);
    int db=0, reszh=0, reszl=0;
    bool alapot=false;
    for (int i=1;i<=n;++i){
        cin>>ho[i];
        if (ho[i]>f){
            ++reszh;
            reszl=0;
        }
        else if (ho[i]<f){
            reszh=0;
            ++reszl;
        }
        if (reszh>=k && alapot==false){
            ++db;
            alapot=true;
        }
        else if (reszl>=l && alapot==true){
            alapot=false;
        } 
    }
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Accepted0/01ms316 KiB
2Wrong answer0/021ms1120 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Accepted2/21ms316 KiB
7Accepted2/21ms316 KiB
8Accepted4/41ms316 KiB
9Accepted4/48ms572 KiB
10Wrong answer0/412ms720 KiB
11Wrong answer0/414ms820 KiB
12Wrong answer0/410ms768 KiB
13Wrong answer0/417ms564 KiB
14Wrong answer0/43ms316 KiB
15Wrong answer0/419ms568 KiB
16Wrong answer0/419ms564 KiB
17Wrong answer0/420ms564 KiB