# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117167 | Just_Solve_The_Problem | Fortune Telling 2 (JOI14_fortune_telling2) | C++11 | 430 ms | 22500 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>
#define ll long long
#define ok puts("ok");
using namespace std;
const int N = (int)4e5 + 7;
struct T {
int tree[N * 4];
T() {
memset(tree, -1, sizeof tree);
}
void upd(int pos, int val, int v = 1, int tl = -1, int tr = 4e5) {
if (tl == tr) {
tree[v] = val;
return ;
}
int mid = (tl + tr) >> 1;
if (pos <= mid) {
upd(pos, val, v + v, tl, mid);
} else {
upd(pos, val, v + v + 1, mid + 1, tr);
}
tree[v] = max(tree[v + v], tree[v + v + 1]);
}
int get(int l, int r, int v = 1, int tl = -1, int tr = 4e5) {
if (tl > r || tr < l) return -1;
if (l <= tl && tr <= r) return tree[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... |