191202025-11-25 12:29:47MrkzHőségriadó (50 pont)cpp17Wrong answer 16/5024ms1052 KiB
#include <bits/stdc++.h>

using namespace std;
int N,K,L,F,tmp,megoldas,v,c;
vector<int> ho;
int main()
{
    //ifstream f("ho.in");
    cin>>N>>K>>L>>F;
    ho.push_back(0);
    for(int i=1;i<=N;i++){
        cin>>tmp;
        ho.push_back(tmp);
    }
    ho.resize(N+1);
    for(int i=1;i<=N;i++){
        if(ho[i]>F)
            v++;
        if(v==K && ho[i]>F){
            megoldas++;
        }
        if(ho[i]<F && v!=0)
            c++;
        if(v!=0 && c==L){
            v=0;
            c=0;
        }
    }
    cout<<megoldas;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base16/50
1Accepted0/01ms316 KiB
2Wrong answer0/024ms940 KiB
3Accepted2/21ms512 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Accepted4/41ms316 KiB
9Accepted4/410ms632 KiB
10Wrong answer0/413ms712 KiB
11Wrong answer0/414ms660 KiB
12Wrong answer0/413ms772 KiB
13Wrong answer0/418ms932 KiB
14Wrong answer0/43ms432 KiB
15Wrong answer0/421ms996 KiB
16Wrong answer0/423ms1024 KiB
17Wrong answer0/421ms1052 KiB