# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1119989 | dsyz | Rainforest Jumps (APIO21_jumps) | C++17 | 4056 ms | 31960 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;
using ll = long long;
#define MAXN (1000005)
ll N;
vector<ll> v[MAXN];
void init(int n, vector<int> H){
N = n;
stack<ll> s;
for(ll i = 0;i < N;i++){
while(!s.empty() && s.top() < H[i]){
s.pop();
}
if(!s.empty()){
v[s.top()].push_back(i);
v[i].push_back(s.top());
}
s.push(i);
}
while(!s.empty()){
s.pop();
}
for(ll i = N - 1;i >= 0;i--){
while(!s.empty() && s.top() < H[i]){
s.pop();
}
if(!s.empty()){
v[s.top()].push_back(i);
v[i].push_back(s.top());
# | 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... |