Around the Table
시간 제한6초메모리 제한2048 MB
최대 60번의 착석 실험을 통해 각 사람이 둘러앉은 자리에서 양옆 사람보다 일찍 도착한 사람 목록을 받고, 비밀 좌석 배치를 알아낸다.
문제
There will be people numbered from to , and a room with a round table that has exactly seats, with each person having a distinct reserved seat that hasn't been revealed yet.
To figure out the reserved seat of each person, up to meetings of the guests can be organized in the dining room. Before each meeting, you can decide the order in which the guests will arrive. After each meeting, you will receive a list of the guests who arrived earlier than both of their neighbors in the secret seating arrangement at the table.
For each seat, find the person it is reserved for using the information gathered by the result of the meetings.