#include "ricehub.h"
#include "iostream"
#include "vector"
#include "map"
#include "math.h"
#include "string"
#include "algorithm"
#include "set"
#include <iterator>
#include <string.h>
#include <queue>
#include <list>
using namespace std;
typedef long long ll ;
const ll M = 1e9 + 7 ;
const ll oo = 1e13 ;
int besthub(int R, int L, int X[], long long B){
int best = 0 ;
for(int i = 1 ; i < L ; ++i){
int a[10010];
for(int j = 0 ; j < R ; ++j){
a[j] = abs(i - X[j]);
}
sort(a , a + R);
int b = B , co = 0;
while(b){
if(b > a[co]){
b -= a[co];
}else{
best = max(best , co);
break;
}
co++;
}
}
return best;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
384 KB |
Output is correct |
2 |
Correct |
21 ms |
256 KB |
Output is correct |
3 |
Execution timed out |
1077 ms |
384 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |