# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744067 | 2023-05-18T07:50:15 Z | vjudge1 | Rice Hub (IOI11_ricehub) | C++17 | 2 ms | 468 KB |
#include<bits/stdc++.h> #include "ricehub.h" using namespace std; int besthub(int R, int L, int X[], long long B) { long long qs[R]; qs[0] = 0; long long ans; for(int i=1;i<=R;++i) { qs[i] = qs[i-1]+X[i-1]; } long long l = 1,r = 5; while(l <= r) { long long mid = (l+r)/2; bool can = false; for(int med = (mid+1)/2;med <= r-mid/2;++med) { long long sumLeft = qs[med-(med%2==1)]-qs[med-mid/2+(med%2==0)]; long long sumRight = qs[med+mid/2]-qs[med+1]; long long cost = sumRight - sumLeft; if(cost <= B) { can = true; break; } } if(can) { ans = mid; l = mid+1; } else r = mid-1; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 468 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |