Submission #61955

# Submission time Handle Problem Language Result Execution time Memory
61955 2018-07-27T06:26:51 Z 김현수(#2139) popa (BOI18_popa) C++11
0 / 100
19 ms 436 KB
#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;
	}
	vector<int> S;
	S.push_back(N);
	for(int i=1;i<N;i++) {
		int P = 0;
		while(!S.empty()) {
			int T = S.back();
			if(Right[T] == -1 && query(T, T, T, i)) {
				Right[T] = i;
				break;
			}
			else S.pop_back();
		}
		if(S.empty()) {
			Left[i] = P;
		}
		S.push_back(i);
	}
	return S[0];
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB not a valid binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 436 KB not a valid binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 436 KB not a valid binary tree
2 Halted 0 ms 0 KB -