Submission #96951

#TimeUsernameProblemLanguageResultExecution timeMemory
96951dalgerokpopa (BOI18_popa)C++14
100 / 100
87 ms444 KiB
#include<bits/stdc++.h> #include<popa.h> using namespace std; const int N = 1005; int le[N], ri[N]; int solve(int n, int *le, int *ri){ for(int i = 0; i < n; i++){ le[i] = ri[i] = -1; } vector < int > st; for(int i = 0; i < n; i++){ while(!st.empty() && query(st.back(), i, i, i) == true){ ri[st.back()] = le[i]; le[i] = st.back(); st.pop_back(); } st.push_back(i); } while((int)st.size() > 1){ ri[st[(int)st.size() - 2]] = st.back(); st.pop_back(); } return st[0]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...