#include <bits/stdc++.h>
using namespace std;
int besthub(int R,int L,int X[],long long B){
vector<int> V(L+1,0);
long long ans=0;
long long res=1;
for(int i=0;i<R;i++){
V[X[i]]++;
}
for(int i=1;i<=B;i++){
ans+=V[i];
}
long long maxsum=ans;
for(int i=B+1;i<=L;i++){
ans-=V[i-B];
ans+=V[i];
if(ans>maxsum){
res=i;
maxsum=ans;
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
848 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |