# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
722074 | irmuun | Rainforest Jumps (APIO21_jumps) | C++17 | 4090 ms | 54404 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;
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
const int maxn=200005,INF=1e9,lg=24;
bool ok=true;
vector<int>adj[maxn+5];
int n,high[lg][maxn],low[lg][maxn],h[maxn],dist[maxn];
int get_path(int *x,int y,int jmp[][maxn]){
int tot=0;
for(int i=20;i>=0;i--){
if(jmp[i][*x]!=-1&&h[jmp[i][*x]]<=h[y]){
*x=jmp[i][*x];
tot+=(1<<i);
}
}
return tot;
}
int sub5(int x,int y){
int num1=get_path(&x,y,high);
int num2=get_path(&x,y,low);
if(h[x]==h[y]) return num1+num2;
# | 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... |