# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
157578 | 2019-10-12T13:24:25 Z | RoundMango | Rice Hub (IOI11_ricehub) | C++14 | 5 ms | 632 KB |
#include <bits/stdc++.h> using namespace std; long long a[100005], ans, sum[100005]; long long b; int besthub(int R, int L, int a[], long long b) { long long n, m, l, r, md, mx, ans; for (int i = 1; i <= R; i++) sum[i] = sum[i-1] + a[i]; l = 1; r = R; while (l < r) { md = (l+r+1)>>1; for (int i = md; i <= R; i++) { long long xx; ans = 1e10; n = i-md+1; mx = (n+i+1)>>1; xx = sum[i] - sum[mx] - (i-mx)*a[mx] + a[mx]*(mx-n) - sum[mx-1] + sum[n-1]; ans = min(ans,xx); } if (ans <= b) l = md; else r = md-1; } return l; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 508 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 504 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 632 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |