# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28846 | kavun | Rice Hub (IOI11_ricehub) | C++14 | 1000 ms | 5924 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>
#include "ricehub.h"
#include <stdio.h>
#include <stdlib.h>
#define MAX_R 1000000
using namespace std;
typedef long long ll;
int besthub(int R, int L, int X[], long long B)
{
for(int res = R; res > 0; res--)
{
for(int i = 0; i <= R - res; i++)
{
int median = (2*i+res-1) / res;
ll cost = 0;
for(int j = i; j < i+res; j++)
{
cost += abs(X[j] - X[median]);
}
if(cost <= B)
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... |