Submission #1256142

#TimeUsernameProblemLanguageResultExecution timeMemory
1256142gelastropodpopa (BOI18_popa)C++20
0 / 100
5 ms420 KiB
#include "popa.h" #include <bits/stdc++.h> using namespace std; int solve(int N, int* Left, int* Right) { stack<int> stk; stk.push(0); for (int i = 0; i < N; i++) Left[i] = -1, Right[i] = -1; for (int i = 1; i < N; i++) { int prev = -1; while (stk.size() && query(stk.top(), i, stk.top(), stk.top())) prev = stk.top(), stk.pop(); if (prev == -1) Right[stk.top()] = i; else { Left[i] = prev; if (stk.size()) Right[stk.top()] = i; } stk.push(i); } while (stk.size() > 1) stk.pop(); return stk.top(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...