# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1059290 | VMaksimoski008 | 밀림 점프 (APIO21_jumps) | C++17 | 4027 ms | 67016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "jumps.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n, L[maxn][20], R[maxn][20], up[maxn][20], up2[maxn][20], sub1 = 1;
vector<int> v;
void init(int N, vector<int> H) {
n = N;
v.push_back(1e9);
for(int &x : H) v.push_back(x);
v.push_back(1e9);
stack<pair<int, int> > st; st.push({ 1e9, 0 });
for(int i=1; i<=n; i++) {
if(v[i] != i) sub1 = 0;
while(!st.empty() && st.top().first <= v[i]) st.pop();
L[i][0] = st.top().second;
st.push({ v[i], i });
}
while(!st.empty()) st.pop();
st.push({ 1e9, n + 1 });
for(int i=n; i>=1; i--) {
while(!st.empty() && st.top().first <= v[i]) st.pop();
R[i][0] = st.top().second;
st.push({ v[i], 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... |