Submission #1099474

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10994742024-10-11 11:33:04gygRainforest Jumps (APIO21_jumps)C++17
0 / 100
170 ms64548 KiB
#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];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...