| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 660152 | kinope | Editor (BOI15_edi) | C++14 | 116 ms | 11900 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct p{
		int v; bool on;
};
int main(){
	int n;
	scanf("%d", &n);
	
	vector<p> act(n);
	vector<int> ojc(n, -1);
	set<pair<int, int>> s;
	
	for(int i = 0; i < n; ++i){
			int a;
			scanf("%d", &a);
			if(a > 0){
					act[i] = {a, 1};
					s.emplace(i, a);
					printf("%d\n", (*prev(s.end())).second);
					continue;
			}
			act[i] = {a, 1};
			
			for(int j = i-1; ~j; --j) if(act[j].v > a){
					ojc[i] = j;
					for(int x = j; ~x; x = ojc[x]){
							act[x].on^=1;
							if(ojc[x] < 0){
									pair<int, int> tmp = {x, act[x].v};
									if(act[x].on) s.emplace(x, act[x].v);
									else s.erase(tmp);
							}
					}
					break;
			}
			if(s.empty()) printf("0\n");
			else printf("%d\n", (*prev(s.end())).second);
	}
	
	return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
