# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
542018 | Pherokung | Rainforest Jumps (APIO21_jumps) | C++14 | 232 ms | 40108 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;
#define ll long long
#define F first
#define S second
typedef pair<int,int> pa;
int n,h[200005],l[200005][20],r[200005][20],mx[200005][20];
stack<int> stk;
void init(int N, vector<int> H) {
n = N;
for(int i=0;i<N;i++) h[i+1] = H[i];
h[n+1] = -1;
h[0] = -1;
for(int i=1;i<=n;i++){
while(!stk.empty()){
if(h[stk.top()] < h[i]) stk.pop();
else break;
}
if(stk.empty()) l[i][0] = -1;
else l[i][0] = stk.top();
stk.push(i);
}
while(!stk.empty()) stk.pop();
for(int i=n;i>=1;i--){
while(!stk.empty()){
# | 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... |