# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
787014 | ToniB | Rainforest Jumps (APIO21_jumps) | C++17 | 1227 ms | 64736 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"
#define X first
#define Y second
using namespace std;
const int MAXN = 2e5 + 2;
const int LOG = 18;
const int OFF = 1 << LOG + 1;
int n, nxt[MAXN][LOG], prv[MAXN], prv_max[MAXN][LOG];
int jump[MAXN][LOG], max_reachable[MAXN][LOG];
pair<int, int> tour[OFF];
vector<int> h;
pair<int, int> f(int x, int l, int r, int ql, int qr){
if(ql > r || l > qr) return {-1, -1};
if(ql <= l && r <= qr) return tour[x];
int mid = (l + r) >> 1;
pair<int, int> L = f(x * 2 + 1, l, mid, ql, qr);
pair<int, int> R = f(x * 2 + 2, mid + 1, r, ql, qr);
return max(L, R);
}
void con(int x, int l, int r){
if(l == r){
tour[x] = {h[l], l};
return ;
}
int mid = (l + r) >> 1;
con(x * 2 + 1, l, mid);
con(x * 2 + 2, 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |