제출 #703038

#제출 시각아이디문제언어결과실행 시간메모리
703038siewjhpopa (BOI18_popa)C++17
0 / 100
14 ms300 KiB
#include <bits/stdc++.h> #include "popa.h" using namespace std; int solve(int N, int* Left, int* Right){ stack<int> s; for (int i = 0; i < N; i++){ Left[i] = -1; Right[i] = -1; } for (int i = 0; i < N; i++){ while (!s.empty()){ int x = s.top(); if (query(x, x, x, i)) break; Right[x] = i; s.pop(); } Left[i] = (s.empty() ? -1 : s.top()); s.push(i); } while (s.size() > 1) s.pop(); return s.top(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...