# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
297207 | PeppaPig | Editor (BOI15_edi) | C++14 | 458 ms | 207612 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 = 3e5+5;
struct node {
int val;
node *l, *r;
node(int val, node *l, node *r) : val(val), l(l), r(r) {}
};
node* newleaf(int val) { return new node(val, NULL, NULL); }
node* newpar(node *l, node *r) { return new node(min(l->val, r->val), l, r); }
int n, ans[N];
node* t[N];
node* build(int l = 1, int r = n) {
if(l == r) return newleaf(N);
int mid = (l + r) >> 1;
return newpar(build(l, mid), build(mid+1, r));
}
node* update(int x, int k, node *p, int l = 1, int r = n) {
if(x < l || r < x) return p;
if(l == r) return newleaf(k);
int mid = (l + r) >> 1;
return newpar(update(x, k, p->l, l, mid), update(x, k, p->r, mid+1, r));
}
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... |