# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
950433 |
2024-03-20T10:06:42 Z |
irmuun |
Rice Hub (IOI11_ricehub) |
C++17 |
|
1000 ms |
1728 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
int besthub(int R,int L,int X[],ll B){
int ans=0;
for(int i=0;i<=L;i++){
ll cost=0;
int cur=0;
vector<ll>dist;
for(int j=0;j<R;j++){
dist.pb(abs(X[j]-i));
}
sort(all(dist));
for(int j=0;j<R;j++){
if(cost+dist[j]<=B){
cost+=dist[j];
cur++;
}
else break;
}
ans=max(ans,cur);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
448 KB |
Output is correct |
5 |
Correct |
2 ms |
416 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
452 KB |
Output is correct |
19 |
Correct |
2 ms |
348 KB |
Output is correct |
20 |
Correct |
2 ms |
348 KB |
Output is correct |
21 |
Correct |
5 ms |
456 KB |
Output is correct |
22 |
Correct |
5 ms |
348 KB |
Output is correct |
23 |
Correct |
72 ms |
348 KB |
Output is correct |
24 |
Correct |
73 ms |
428 KB |
Output is correct |
25 |
Correct |
71 ms |
428 KB |
Output is correct |
26 |
Correct |
79 ms |
428 KB |
Output is correct |
27 |
Correct |
61 ms |
344 KB |
Output is correct |
28 |
Correct |
61 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
544 KB |
Output is correct |
2 |
Correct |
17 ms |
452 KB |
Output is correct |
3 |
Execution timed out |
1022 ms |
344 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1033 ms |
1728 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |