# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109899 | ozner77 | Rice Hub (IOI11_ricehub) | C++17 | 4 ms | 1016 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 maxsum;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |