191242025-11-25 12:44:04MrkzHőségriadó (50 pont)cpp17Wrong answer 12/5021ms1032 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;
    //bool S[N]={false};
    ho.push_back(0);
    for(int i=1;i<=N;i++){
        cin>>tmp;
        ho.push_back(tmp);
        //if(tmp>F)
          //  S[i]=true;
    }
    ho.resize(N+1);
    for(int i=1;i<=N;i++){
        if(ho[i]>=F){
            v++;
            c=0;
        }
        if(v==K && ho[i]>=F){
            megoldas++;
        }
        if(ho[i]<F && v!=0)
            c++;
        if(v!=0 && c==L){
            v=0;
            c=0;
        }
    }
    /*int i=1;
    while(i<=N){
        while(ho[i]>F){
            v++;
            if(v==K)
                megoldas++;
            i++;
        }
        while()
    }*/
    cout<<megoldas;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/50
1Accepted0/01ms316 KiB
2Wrong answer0/021ms948 KiB
3Accepted2/21ms316 KiB
4Accepted2/21ms316 KiB
5Accepted2/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms512 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/49ms688 KiB
10Wrong answer0/412ms672 KiB
11Wrong answer0/414ms760 KiB
12Wrong answer0/412ms664 KiB
13Wrong answer0/417ms944 KiB
14Accepted4/43ms316 KiB
15Wrong answer0/419ms1032 KiB
16Wrong answer0/420ms1032 KiB
17Wrong answer0/420ms884 KiB