#include<bits/stdc++.h>
#include "popa.h"
using namespace std;
int solve(int n,int* lf,int* rg){
stack<int> s;
for(int i = 0 ; i < n ; i ++){
lf[i]=-1;
rg[i]=-1;
while(s.size()&&!query(s.top(),s.top(),s.top(),i)){
lf[i]=s.top();
s.pop();
}
if(s.size()){
rg[s.top()]=i;
}
s.push(i);
}
while(s.size()>1)s.pop();
return s.top();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
248 KB |
Output is correct |
2 |
Correct |
17 ms |
376 KB |
Output is correct |
3 |
Correct |
7 ms |
248 KB |
Output is correct |
4 |
Correct |
7 ms |
312 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
324 KB |
Output is correct |
2 |
Correct |
79 ms |
328 KB |
Output is correct |
3 |
Correct |
48 ms |
328 KB |
Output is correct |
4 |
Correct |
57 ms |
324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
328 KB |
Output is correct |
2 |
Correct |
58 ms |
324 KB |
Output is correct |
3 |
Correct |
60 ms |
328 KB |
Output is correct |
4 |
Correct |
54 ms |
328 KB |
Output is correct |