Logo
(追記) (追記ここまで)

32539번 - Chaotic Cables 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB49181666.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:

  1. Devices are connected if and only if their addresses differ in exactly one bit.
  2. Each possible address is assigned to exactly one device.

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:

  • One line with two integers $n$ and $m$ (2ドル \le n \le 2\cdot 10^5,ドル 1ドル \le m \le 2\cdot 10^5$) the number of devices and the number of wires in the network.
  • $m$ lines with integers $a$ and $b$ (1ドル \leq a, b \leq n,ドル $a \ne b$), indicating that there is a wire between devices $a$ and $b$.

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".

제한

예제 입력 1

4 3
1 2
2 3
1 4

예제 출력 1

no

예제 입력 2

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

예제 출력 2

yes

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries C번

  • 문제를 만든 사람: Mees de Vries
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /