| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 388042 | Pichon5 | Rice Hub (IOI11_ricehub) | C++17 | 1092 ms | 484 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>
#define vi vector<int>
#define pb push_back
#define ll long long int
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
vi v;
int res=0;
for(int i=0;i<R;i++){
v.clear();
for(int l=i;l<R;l++){
v.pb(X[l]);
int ans=0;
ll Baux=B;
int mid=v.size()/2;
for(int j=0;j<v.size();j++){
if(Baux-abs(v[j]-v[mid])>=0){
ans++;
Baux-=abs(v[j]-v[mid]);
}else{
break;
}
}
res=max(res,ans);
}
}
return res;
}
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... | ||||
