#include "bits/stdc++.h"
#include "ricehub.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
int besthub(int r, int l, int x[], ll b){
int answer = 0;
deque<int> diff;
for(int cor = 1; cor <= l; ++cor){
diff.clear();
int sm = 0;
for(int i = 0; i < r; ++i)
diff.push_back(abs(cor-x[i]));
sort(all(diff));
while(1){
if(b-diff[0] >= 0)
b -= diff[0], diff.pop_front(), sm++;
else
break;
}
answer = max(answer, sm);
}
return answer;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
448 KB |
Output is correct |
3 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
448 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1070 ms |
604 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |