# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
27092 | tlwpdus | Editor (BOI15_edi) | C++98 | 896 ms | 399308 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;
int n;
struct node {
node *l, *r;
int val;
node() {val = 0; l = r = NULL;}
node(int v):val(v){l = r = NULL;}
void init(int s = 0, int e = n) {
if (s==e) return;
int m = (s+e)>>1;
if (!l) l = new node();
if (!r) r = new node();
l->init(s,m); r->init(m+1,e);
val = max(l->val,r->val);
}
int getv(int S, int E, int s = 0, int e = n) {
if (e<S||E<s) return 0;
if (S<=s&&e<=E) return val;
int m = (s+e)>>1;
return max(l->getv(S,E,s,m),r->getv(S,E,m+1,e));
}
node* upd(int idx, int val, node *ori, int s = 0, int e = n) {
if (e<idx||idx<s) return ori;
if (s==e) return new node(val);
int m = (s+e)>>1;
if (!l) l = new node();
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... |