Interactive Vertex
시간 제한2초메모리 제한512 MB
트리에서 숨겨진 특별 정점을 찾아야 한다. 각 질의는 정점 x와 정점 집합을 주면 x가 집합의 모든 정점보다 특별 정점에 가깝거나 같은지 알려준다. 질의 횟수는 4*ceil(log2 n) 이하로 제한된다.
문제
This is an interactive problem.
Endagorion has a tree on vertices, and he also showed it to you. He chooses one vertex as a special vertex, but now he won't tell you anything about it!
Instead, you can ask him questions. For each question, you should choose a vertex , an integer , and vertices , and he will tell you whether it is true that . Here, is the number of edges in the simple path between vertices and in the tree.
You should guess the special vertex using at most queries.
Endagorion is very honest, so he wouldn't change the vertex between your queries (in other words, the interactor is not adaptive).
As the constraints are large, and flush is an expensive operation, make sure that you are not flushing too often. You may do it only once after each query.
힌트
