# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
639747 |
2022-09-11T13:00:46 Z |
bonk |
Rice Hub (IOI11_ricehub) |
C++14 |
|
1000 ms |
524 KB |
#include <bits/stdc++.h>
#include <ricehub.h>
using namespace std;
using ll = long long;
int besthub(int r, int l, int x[], ll b){
ll ans = 0;
for(int i = 1; i <= l; i++){
priority_queue<ll>pq;
ll cost = 0;
ll tmp = 0;
for(int j = 0; j < r; j++){
ll a = abs(x[j] - i);
if(cost + a <= b){
pq.push(a);
cost += a;
tmp++;
} else if(!pq.empty() && pq.top() > a){
cost -= pq.top();
cost += a;
pq.push(a);
}
}
ans = max(ans, tmp);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1075 ms |
524 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |