Conflict
시간 제한3초메모리 제한1024 MB
건물의 전원을 하나씩 끊으면서 끊는 시점에 아직 전원이 살아 있는 이웃과 연결된 도로 수를 보고받아, 최대 N-1번의 질의로 다중 그래프의 모든 간선을 알아내는 인터랙티브 문제이다.
문제
In a desperate conflict, with a ruthless enemy...
This is an interactive problem.
As an elite spy fighting against a great evil empire, you have been tasked with separate reconnaissance missions. Each mission takes place in a different city of the empire, and your success is crucial to the resistance.
Every city is represented by key buildings, numbered from to , connected by a network of roads. Each road connects two different buildings, and there may be multiple roads between the same pair of buildings. Your objective for each mission is to fully reconstruct the city's road network.
To achieve this, you are equipped with a special device capable of performing a sequential shutdown of the city's power grid. You can define a shutdown sequence --- a permutation of all buildings. At the exact moment when the power to building is cut, the device reports the number of roads that connect to other buildings that still have power.
You are allowed to use this device at most times during each mission.
제한
- The sum of over all test cases is at most .
- The sum of over all test cases is at most .
힌트
After printing each query, you must flush the output buffer to ensure the interactor receives your output. Failing to do so can result in an unexpected verdict. You can flush the output by using the following methods:
- In
C++, callfflush(stdout)orcout.flush(). - In
Java, callSystem.out.flush(). - In
Python, callsys.stdout.flush(). - In
Kotlin, callSystem.out.flush().
For other languages, you should refer to the official documentation for your language.