#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std ;
using ll = long long ;
using pii = pair<ll , ll> ;
const int N = 1e6+5 ;
ll qs[N] , ans ;
int besthub(int R, int L, int X[], long long B)
{
for(int i=0;i<L;i++){
ll cnt = 0 , sum = 0 ;
for(int j=0;j<R;j++){
if(X[j] >= i - B && X[j] <= i + B){
sum += abs(X[j] - i) ;
cnt++ ;
}
if(sum > B) break;
}
ans = max(ans , cnt);
}
return ans ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
559 ms |
372 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |