#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct Hull{
deque<ll> dq;
ll s;
Hull(){
s= 0;
}
void add(ll pos){
s += pos-dq[(dq.size())/2];
dq.push_back(pos);
}
void rem(){
ll pos = dq.front();
s-= dq[(dq.size())/2] -pos;
dq.pop_front();
}
};
int besthub(int R, int L, int X[], long long B){
Hull my_hull;
int res= 0;
/*for(int i = 0; i<R; i++){
my_hull.add(X[i]);
while(my_hull.s>B){
my_hull.rem();
}
res= max(res, (int)my_hull.dq.size());
}*/
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
368 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |