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 <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include "popa.h"
using namespace std;
typedef long long llong;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;
int n;
int solve(int N, int * L, int * R) {
n = N;
for (int i = 0; i < n; ++i) L[i] = R[i] = -1;
vector<int> st;
st.push_back(0);
for (int i = 1; i < n; ++i) {
while (!st.empty() && query(st.back(), i, i, i)) {
R[st.back()] = L[i];
L[i] = st.back();
st.pop_back();
}
if (!st.empty()) R[st.back()] = i;
st.push_back(i);
}
return st[0];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |