# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
418220 | 2021-06-05T08:29:19 Z | Maqsut_03 | Rice Hub (IOI11_ricehub) | C++14 | 3 ms | 460 KB |
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; const int M = 1e9 + 7; int besthub(int R, int L, int X[], long long B) { int ans = M, m; for (int i=0; i<R; i++) { int sum = 0, b = B, j = i; int l = i, r = i; while (1) { if (r < R && l >= 0 && X[i] - X[l] <= X[r] - X[i]) m = X[i] - X[l], l--; else if (r < R) m = X[r] - X[i], r++; else break; if (m > b) break; else sum++, b -= m; } ans = min(ans, sum); } return R; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 460 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |