# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
434156 | illyakr | Rice Hub (IOI11_ricehub) | C++14 | 129 ms | 3268 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>
#include "ricehub.h"
using namespace std;
#define ll long long
ll Abs(ll x) {
if (x < 0)return -x;
return x;
}
ll have;
ll n;
ll a[101010];
ll res = 0;
ll pref[101010];
ll gt(ll l, ll r) {
return pref[r] - pref[l - 1];
}
ll scbp(ll sum, ll id) {
ll l = 0, r = id + 1;
while (l + 1 < r) {
ll mid = (l + r) / 2;
ll md = (a[id] * (id - mid + 1)) - gt(mid, id);
if (md + sum > have)l = mid;
else r = mid;
}
return r;
}
int besthub(int R, int L, int X[], long long B) {
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... |