#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
priority_queue<int, vector<int>, greater<int>> q;
int besthub(int R, int L, int X[], long long B)
{
for(int i=0;i<R;i++) {
q.push(abs(X[i] - X[R/2]));
}
long long ans = 0 , cou = 0;
while (!q.empty()) {
int t = q.top(); q.pop();
cou += t;
if (cou>B) break;
ans++;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
2 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
312 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
292 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Incorrect |
2 ms |
312 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
14 ms |
284 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
724 KB |
Output is correct |
2 |
Correct |
4 ms |
724 KB |
Output is correct |
3 |
Correct |
22 ms |
1580 KB |
Output is correct |
4 |
Correct |
23 ms |
1516 KB |
Output is correct |
5 |
Correct |
24 ms |
1100 KB |
Output is correct |
6 |
Correct |
7 ms |
1196 KB |
Output is correct |
7 |
Correct |
20 ms |
2012 KB |
Output is correct |
8 |
Correct |
21 ms |
2128 KB |
Output is correct |
9 |
Correct |
7 ms |
1184 KB |
Output is correct |
10 |
Correct |
7 ms |
1108 KB |
Output is correct |
11 |
Correct |
29 ms |
2288 KB |
Output is correct |
12 |
Correct |
22 ms |
2344 KB |
Output is correct |
13 |
Incorrect |
7 ms |
1244 KB |
Output isn't correct |
14 |
Halted |
0 ms |
0 KB |
- |