# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
649615 | alvinpiter | Rainforest Jumps (APIO21_jumps) | C++17 | 1755 ms | 52108 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;
#define INF 1000000000
#define MAXN 200000
#define MAXH 200000
#define MAXLG 17
int n, prevHigher[MAXN + 3], nextHigher[MAXN + 3], highest[MAXH + 3][MAXLG + 3], secondHighest[MAXH + 3][MAXLG + 3];
int spTableMax[MAXN + 3][MAXLG + 3];
vector<int> h;
void initPrevHigher() {
stack<int> stHeight;
for (int i = 0; i < n; i++) {
while (!stHeight.empty() && h[i] > stHeight.top()) {
stHeight.pop();
}
prevHigher[i] = (stHeight.empty() ? INF : stHeight.top());
stHeight.push(h[i]);
}
}
void initNextHigher() {
stack<int> stHeight;
for (int i = n - 1; i >= 0; i--) {
while (!stHeight.empty() && h[i] > stHeight.top()) {
stHeight.pop();
}
# | 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... |