# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
655196 | PanTkd | Rice Hub (IOI11_ricehub) | C++14 | 1081 ms | 468 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 <iostream>
#include <cmath>
typedef long long ll;
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
for(ll i = R;i>=1;i--){
for(ll j = 0;j<R-i;j++){
ll cost = 0;
ll med = i/2+j;
for(ll k = j ;k<=j+i-1 && k<=R;k++){
cost+= abs(X[med]-X[k]);
}
if(cost<=B)
return i;
}
}
}
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... |