# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727195 | iskhakkutbilim | Rainforest Jumps (APIO21_jumps) | C++14 | 4096 ms | 20756 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;
const int MAXN = 2e5;
int dis[2001][2001];
vector<int> g[MAXN+1];
vector<int> h;
int n, srt;
void init(int N, vector<int> H){
n = N, srt = 1, h = H;
for(int i = 1;i < N; i++){
if(h[i-1] > h[i]) srt = 0;
}
stack<int> st;
st.push(MAXN+MAXN);
for(int i = N-1;i >= 0; i--){
while(h[i] >= st.top()){
st.pop();
}
if(st.top()<= MAXN) g[h[i]].push_back(st.top());
st.push(h[i]);
}
reverse(h.begin(), h.end());
while(!st.empty()) st.pop();
st.push(MAXN+MAXN);
for(int i = N-1;i >= 0; i--){
while(h[i] >= st.top()){
st.pop();
}
if(st.top()<= MAXN) g[h[i]].push_back(st.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... |