# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
27091 | khsoo01 | Editor (BOI15_edi) | C++11 | 683 ms | 211872 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<bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, a[N];
struct node {
int v; node *lc, *rc;
node () {v=0; lc=NULL; rc=NULL;}
void init (int L=0, int R=n) {
if(L == R) return;
int M = (L+R)/2;
lc = new node(); lc->init(L, M);
rc = new node(); rc->init(M+1, R);
}
void upd (node *Q, int P, int V, int L=0, int R=n) {
if(L == R) {v = max(Q->v, V); return;}
int M = (L+R)/2;
if(P <= M) {
rc = Q->rc; lc = new node();
lc->upd(Q->lc, P, V, L, M);
}
else {
lc = Q->lc; rc = new node();
rc->upd(Q->rc, P, V, M+1, R);
}
v = max(lc->v, rc->v);
}
int get (int S, int E, int L=0, int R=n) {
if(S <= L && R <= E) return v;
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... |