# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
431723 | faresbasbs | Fortune Telling 2 (JOI14_fortune_telling2) | C++14 | 820 ms | 41356 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 MXN = 700 * 1000 + 3;
int tree[MXN << 2], a[MXN], b[MXN], t[MXN], oga[MXN], ogb[MXN];
vector<int> coord, q[MXN];
int n, k, sz;
function<int(int, int)> comb = [] (int x, int y) {
return max(x, y);
};
void update(int v, int tl, int tr, int pos, int x) {
if(tl == tr)
tree[v] = comb(tree[v], x);
else {
int tm = (tl + tr) >> 1;
if(pos <= tm)
update(v << 1, tl, tm, pos, x);
else
update(v << 1|1, tm + 1, tr, pos, x);
tree[v] = comb(tree[v << 1], tree[v << 1|1]);
}
}
void upd(int pos, int x) {
update(1, 1, MXN - 2, pos, x);
}
int query(int v, int tl, int tr, int l, int r) {
if(l > r)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |