# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570109 | Cyber_Wolf | Rainforest Jumps (APIO21_jumps) | C++14 | 4022 ms | 24612 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 "stub.cpp"
#include <bits/stdc++.h>
using namespace std;
#define lg long long
const lg sz = 2e5+5;
vector<lg> adj[sz];
bool flag = true;
void init(int N, std::vector<int> H)
{
vector<lg> loc(N+1);
for(int i = 0; i < N; i++)
{
flag &= (H[i] == i+1);
loc[H[i]] = i;
}
if(flag) return;
set<lg> se;
se.emplace(loc[N]);
for(int i = N-1; i >= 1; i--)
{
auto it = se.lower_bound(loc[i]);
if(it != se.end()) adj[loc[i]].push_back(*it);
if(it != se.begin()) adj[loc[i]].push_back(*(--it));
se.emplace(loc[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... |