# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1177389 | anmattroi | Rainforest Jumps (APIO21_jumps) | C++17 | 579 ms | 77472 KiB |
#include "jumps.h"
#include <bits/stdc++.h>
#define maxn 200005
#define fi first
#define se second
using namespace std;
using ii = pair<int, int>;
int n, h[maxn], pre[maxn], nex[maxn];
int f[20][maxn];
int jp[20][maxn], gojo[20][maxn];
ii orz[20][maxn];
void init(int N, vector<int> H) {
n = N;
for (int i = 1; i <= n; i++) h[i] = H[i-1];
h[0] = h[n+1] = INT_MAX;
for (int i = 1; i <= n; i++) {
int k = i-1;
while (h[k] < h[i]) k = pre[k];
pre[i] = k;
}
for (int i = n; i >= 1; i--) {
int k = i+1;
while (h[k] < h[i]) k = nex[k];
nex[i] = k;
}
for (int i = 1; i <= n; i++) {
jp[0][i] = pre[i];
gojo[0][i] = nex[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... |