# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
895147 | anton | 쌀 창고 (IOI11_ricehub) | C++17 | 15 ms | 4596 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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){
if(dq.size()>0){
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();
}
if(my_hull.dq.size()>res){
res=my_hull.dq.size();
}
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |