#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
int solve(int N, int* Left, int* Right){
for(int i = 0; i < N; i++) Left[i] = Right[i] = -1;
stack<int> st;
for(int i = 0; i < N; i++){
int pref = -1;
while(!st.empty()){
int First = st.top();
if(query(First, First, First, i)){
Right[First] = i;
break;
}
pref = First;
st.pop();
}
Left[i] = pref;
st.push(i);
}
if(st.empty()) assert(false);
while(st.size() > 1) st.pop();
return st.top();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
4 ms |
344 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
428 KB |
Output is correct |
2 |
Correct |
41 ms |
920 KB |
Output is correct |
3 |
Correct |
29 ms |
608 KB |
Output is correct |
4 |
Correct |
41 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
432 KB |
Output is correct |
2 |
Correct |
50 ms |
676 KB |
Output is correct |
3 |
Correct |
50 ms |
440 KB |
Output is correct |
4 |
Correct |
44 ms |
444 KB |
Output is correct |