# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099474 | gyg | Rainforest Jumps (APIO21_jumps) | C++17 | 170 ms | 64548 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;
using lint = long long;
#define arr array
#define vct vector
const lint N = 2e5 + 5;
lint n;
arr<lint, N> h;
arr<lint, N> l, r;
arr<arr<lint, 22>, N> jmp1, jmp2;
void prcmp() {
stack<lint> ord;
for (lint i = 1; i <= n; i++) {
while (ord.size() && h[ord.top()] < h[i]) ord.pop();
if (ord.size()) l[i] = ord.top();
ord.push(i);
}
while (ord.size()) ord.pop();
for (lint i = n; i >= 1; i--) {
while (ord.size() && h[ord.top()] < h[i]) ord.pop();
if (ord.size()) r[i] = ord.top();
ord.push(i);
}
for (lint u = 1; u <= n; u++) {
jmp1[u][0] = (h[l[u]] > h[r[u]]) ? l[u] : r[u];
jmp2[u][0] = r[u];
# | 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... |