제출 #1099473

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10994732024-10-11 11:26:59gyg밀림 점프 (APIO21_jumps)C++17
0 / 100
178 ms33916 KiB
#include "jumps.h"
#include <bits/stdc++.h>
using namespace std;
#define arr array
#define vct vector
const int N = 2e5 + 5;
int n;
arr<int, N> h;
arr<int, N> l, r;
arr<arr<int, 22>, N> jmp1, jmp2;
void prcmp() {
stack<int> ord;
for (int 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 (int 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 (int 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...