# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206953 | peuch | Rice Hub (IOI11_ricehub) | C++17 | 1093 ms | 764 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 "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
vector<long long> auxVec;
int besthub(int R, int L, int X[], long long B)
{
int ans = 0;
for(int coord = 1; coord <= L; coord++){
int aux = 0;
auxVec.clear();
while(X[aux] < coord && aux < R){
auxVec.push_back(coord - X[aux]);
aux++;
}
while(aux < R){
auxVec.push_back(X[aux]);
aux++;
}
sort(auxVec.begin(), auxVec.end());
for(int i = 1; i < auxVec.size(); i++){
auxVec[i] += auxVec[i - 1];
}
ans = max(ans, (int)(lower_bound(auxVec.begin(), auxVec.end(), B) - auxVec.begin()));
}
return ans;
}
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... |