# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
737398 | phoebe | Rainforest Jumps (APIO21_jumps) | C++17 | 2289 ms | 114056 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>
#include "jumps.h"
using namespace std;
#define ll long long
#define pii pair<int, int>
#define F first
#define S second
#define FOR(i, n) for (int i = 0; i < n; i++)
#define PB push_back
#define ALL(x) x.begin(), x.end()
const int maxn = 2e5 + 10, INF = 1e9 + 7;
int n, h[maxn], tree[maxn * 4],
jump_mn[maxn][20], jump_mx[maxn][20], jump_right[maxn][20];
vector<pii> mst[maxn * 4];
void build(int tl = 0, int tr = maxn, int i = 1){
if (tl == tr){
tree[i] = tl;
mst[i].PB({h[tl], tl});
return;
}
int tm = (tl + tr) / 2;
build(tl, tm, i * 2); build(tm + 1, tr, i * 2 + 1);
tree[i] = (h[tree[i * 2]] > h[tree[i * 2 + 1]] ?
tree[i * 2] : tree[i * 2 + 1]);
merge(ALL(mst[i * 2]), ALL(mst[i * 2 + 1]), back_inserter(mst[i]));
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |