#include "popa.h"
#include <bits/stdc++.h>
using namespace std;
int solve(int N, int* Left, int* Right) {
stack<int> stk;
for (int i = 0; i < N; i++) {
Left[i] = -1;
Right[i] = -1;
}
stk.push(0);
for (int i = 1; i < N; i++) {
int prev = -1;
while (!stk.empty() && query(stk.top(), i, i, i)) {
prev = stk.top();
stk.pop();
}
if (!stk.empty()) {
Right[stk.top()] = i;
}
Left[i] = prev;
stk.push(i);
}
while (stk.size() != 1) {
stk.pop();
}
return stk.top();
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |