# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
103015 | pavel | Editor (BOI15_edi) | C++14 | 877 ms | 228856 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 <cstdio>
#include <stack>
#include <set>
using namespace std;
typedef pair<int,int> ii;
const int MAXN = 1<<19;
struct node{
node *l, *r;
int x, w;
node(int v, int y=-1){
x=y;
w=v;
if(w>1){
l = new node(w/2, y);
r = new node(w/2, y);
}else{
l = r = nullptr;
}
}
node(const node& o){
x=o.x;w=o.w;l=o.l;r=o.r;
}
int query(int l1, int r1){
if(l1>=w || r1>=w || l1<0 || r1<0) return -1;
if(r1-l1+1==w) return x;
return max(l->query(l1, min(r1, w/2-1)), r->query(max(0, l1-w/2), r1-w/2));
}
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... |