# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430800 | Supersonic | Rainforest Jumps (APIO21_jumps) | C++14 | 1969 ms | 42804 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 "jumps.h"
#include <bits/stdc++.h>
using namespace std;
int n;vector<int> v;
#define SIZE 262144
typedef long long ll;
vector<int> l;vector<int> r;vector<int> t;int y[200001];int pa;
int jm[200001][21];int jr[200001][21];
ll tree[2*SIZE];
int m1=-1,m1i=-1,m2=-1;
int p2[18]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072};
int g(int a,int p){
if(a==-1||a+p2[p]>=n)return -1;
if(jm[a][p]>=0)return jm[a][p];
if(p==0){if(l[a]==-1)jm[a][p]=r[a];else if(r[a]==-1)jm[a][p]=l[a];if(v[l[a]]>v[r[a]])jm[a][p]=l[a];else jm[a][p]=r[a];return jm[a][p];}
jm[a][p]=g(g(a,p-1),p-1);;
return jm[a][p];
}
int gr(int a,int p){
if(a==-1||a+p2[p]>=n)return -1;
if(jr[a][p]>=0)return jr[a][p];
if(p==0){jr[a][p]=r[a];return jr[a][p];}
jr[a][p]=gr(gr(a,p-1),p-1);;
return jr[a][p];
}
void u(int pos, int val) {
pos += SIZE;
tree[pos]=val;
for (pos /= 2; pos >= 1; pos /= 2){
# | 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... |