# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
476810 | Everifall | Rainforest Jumps (APIO21_jumps) | C++14 | 1246 ms | 52764 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;
const int MAXN = 2e5 + 16;
const int MLOG = 21;
int arr[MAXN],spRight[MLOG][MAXN],spLeft[MLOG][MAXN],spBest[MLOG][MAXN];
void init(int N,vector<int> H){
arr[0] = arr[N+1] = N+8;
for(int i=1;i<=N;i++){
arr[i] = H[i-1];
}
stack<int> stkRight,stkLeft;
for(int i=0;i<=N+1;i++){
while((!stkRight.empty()) && arr[stkRight.top()] <= arr[i]){
spRight[0][stkRight.top()] = i;
stkRight.pop();
}
stkRight.push(i);
}
spRight[0][N+1] = N+1;
for(int i=N+1;i>=0;i--){
while((!stkLeft.empty()) && arr[stkLeft.top()] <= arr[i]){
spLeft[0][stkLeft.top()] = i;
stkLeft.pop();
}
stkLeft.push(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... |