답안 #198292

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
198292 2020-01-25T12:33:13 Z forelax popa (BOI18_popa) C++14
100 / 100
79 ms 376 KB
#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 11 ms 248 KB Output is correct
2 Correct 11 ms 376 KB Output is correct
3 Correct 11 ms 248 KB Output is correct
4 Correct 7 ms 296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 60 ms 376 KB Output is correct
2 Correct 50 ms 328 KB Output is correct
3 Correct 39 ms 328 KB Output is correct
4 Correct 67 ms 324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 79 ms 328 KB Output is correct
2 Correct 70 ms 328 KB Output is correct
3 Correct 56 ms 328 KB Output is correct
4 Correct 57 ms 328 KB Output is correct