# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206959 | 2020-03-06T01:53:32 Z | peuch | Rice Hub (IOI11_ricehub) | C++17 | 1000 ms | 760 KB |
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; vector<long long> auxVec; int besthub(int R, int L, int X[], long long B) { int ans = 0; for(int coord = 1; coord <= L; coord++){ int aux = 0; auxVec.clear(); while(X[aux] < coord && aux < R){ auxVec.push_back(coord - X[aux]); aux++; } while(aux < R){ auxVec.push_back(X[aux] - coord); aux++; } sort(auxVec.begin(), auxVec.end()); for(int i = 1; i < auxVec.size(); i++){ int aux = auxVec[i] + auxVec[i - 1]; auxVec[i] = aux; } ans = max(ans, (int)(upper_bound(auxVec.begin(), auxVec.end(), B) - auxVec.begin() - 1)); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 38 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1088 ms | 760 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |