# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
64388 | Just_Solve_The_Problem | popa (BOI18_popa) | C++11 | 110 ms | 656 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 "popa.h"
#include <bits/stdc++.h>
#define pb push_back
#define pii pair < int, int >
#define fr first
#define sc second
#define mk make_pair
using namespace std;
const int N = (int)1e3 + 7;
int pr[N];
int solve(int n, int left[], int right[]) {
vector < int > stk;
int root;
for (int i = 0; i < n; i++) {
left[i] = right[i] = -1;
while (!stk.empty() && query(stk.back(), i, i, i)) {
right[stk.back()] = left[i];
left[i] = stk.back();
stk.pop_back();
}
if (!stk.empty()) right[stk.back()] = i;
else root = i;
stk.pb(i);
}
return root;
}
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... |