# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
412318 | model_code | Rainforest Jumps (APIO21_jumps) | C++17 | 1531 ms | 45772 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 + 5;
const int LOG = 18;
int N;
vector<int> H;
int jump_left[LOG][MAXN];
int jump_right[LOG][MAXN];
int jump_high[LOG][MAXN];
void init(int _N, std::vector<int> _H) {
N = _N;
H = _H;
// Build first larger to the left
stack<int> decreasing_h;
for(int i = 0; i < N; i++){
while(!decreasing_h.empty() && H[decreasing_h.top()] <= H[i])decreasing_h.pop();
if(decreasing_h.empty())jump_left[0][i] = -1;
else jump_left[0][i] = decreasing_h.top();
decreasing_h.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... |