| 19121 | 2025-11-25 12:36:42 | Mrkz | Hőségriadó (50 pont) | cpp17 | Compilation error |
#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;
}open /var/local/lib/isolate/414/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:16:13: error: 'S' was not declared in this scope
16 | S[i]=true;
| ^