| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 49 | 18 | 16 | 66.667% |
Your friend Claas is in charge of designing the network for the newly constructed computer lab. Aware of the critical importance of efficiency in network design, Claas opted for the sophisticated Binary Access Point Configuration (BAPC) network topology.
A network is classified as a BAPC network precisely if we can assign a binary address of a fixed length to each device within the network, ensuring that:
Claas started out wiring devices together, but as the intricate web of connections began to take shape, doubt crept into his mind. Was the network he painstakingly constructed truly a BAPC network?
Help Claas determine if the network is a BAPC network.
The input consists of:
It is guaranteed that each pair of devices is connected by at most one wire.
Output "yes" if the network is a BAPC network. Otherwise, output "no".
4 3 1 2 2 3 1 4
no
8 12 1 2 6 2 8 2 3 1 1 7 3 6 6 5 3 4 8 7 8 5 7 4 5 4
yes
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries C번