# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973558 | Tuanlinh123 | Rainforest Jumps (APIO21_jumps) | C++17 | 950 ms | 64708 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 "stub.cpp"
#include "jumps.h"
#include<bits/stdc++.h>
#define ll int
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
#define sz(a) ((ll)(a).size())
using namespace std;
const ll maxn=200005, inf=1e9;
ll n, sp[20][maxn];
ll L[20][maxn], R[20][maxn], Max[20][maxn];
void init(ll N, vector<ll> H)
{
n=N, H.insert(H.begin(), inf), H.insert(H.end(), inf);
for (ll i=0; i<=n+1; i++) sp[0][i]=H[i];
for (ll i=1; i<20; i++)
for (ll j=0; j+(1<<i)<=n+2; j++)
sp[i][j]=max(sp[i-1][j], sp[i-1][j+(1<<i-1)]);
stack <ll> st; st.push(0), L[0][0]=0;
for (ll i=1; i<=n+1; i++)
{
while (H[st.top()]<H[i]) st.pop();
L[0][i]=st.top(), st.push(i);
}
Compilation message (stderr)
# | 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... |