# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
769308 | dxz05 | Rainforest Jumps (APIO21_jumps) | C++17 | 927 ms | 33304 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 = 200000;
const int Log = 18;
int N;
int low[MaxN][Log], high[MaxN][Log];
int lf[MaxN], rg[MaxN];
vector<int> H;
void init(int _N, vector<int> _H) {
N = _N, H = _H;
stack<int> st;
for (int i = 0; i < N; i++){
while (!st.empty() && H[st.top()] < H[i]) st.pop();
lf[i] = (st.empty() ? -1 : st.top());
st.push(i);
}
while (!st.empty()) st.pop();
for (int i = N - 1; i >= 0; i--){
while (!st.empty() && H[st.top()] < H[i]) st.pop();
rg[i] = (st.empty() ? -1 : st.top());
st.push(i);
# | 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... |