| 17880 | 2025-09-21 19:52:31 | algopro | Fasor (40) | cpp17 | Forditási hiba |
// UUID: 3bd8ef3e-d063-4137-bad7-5f38912f1e7d
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int K;
cin>>N>>K;
int pos=0;
int h=0;
int maxpos=0;
while(pos<N){
int actual;
cin>>actual;
if(actual>h){
h=actual;
maxpos=pos;
}
if(pos-maxpos>K){
cout<<maxpos;
exit(0);
}
pos++
}
}
open /var/local/lib/isolate/413/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:23:22: error: expected ';' before '}' token
23 | pos++
| ^
| ;
24 | }
| ~