Submission #143462

#TimeUsernameProblemLanguageResultExecution timeMemory
143462bortozpopa (BOI18_popa)C++17
100 / 100
105 ms452 KiB
#include "bits/stdc++.h" #include "popa.h" using namespace std; int solve(int N, int* L, int* R) { vector<int> stk; for (int i = 0; i < N; i++) { L[i] = R[i] = -1; while (!stk.empty()) { if (!query(stk.back(), i, i, i)) { break; } L[i] = stk.back(); stk.pop_back(); } if (!stk.empty()) { R[stk.back()] = i; } stk.push_back(i); } return stk[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...