题目描述
仅供参考:
一个国家的 N 个城市通过双向航线相连。
规定一次操作为:
- 选定其中一个城市
- 开设该城市到其它所有城市的航线,同时取消该城市的原有航线
请问是否存在一种操作方式,使得每两个城市之间都存在直达航线(操作次数不限)。
输入格式
第一行,一个整数 N,表示城市的数量。
第二行,一个整数 M,表示初始的航线数量。
接下来的 M 行,每行两个不相等的整数,表示该航线连接的两个城市。
输出格式
若存在符合题意的操作方式,则输出 DA。否则输出 NE。
样例输入 #1
2 0
样例输出 #1
DA
样例输入 #2
3 2 1 2 2 3
样例输出 #2
NE
样例输入 #3
4 2 1 3 2 4
样例输出 #3
DA
提示
Clarification of the first test case: In the first step, Krump will introduce the (only possible) line 1-2.
Clarification of the third case: If Krump first chooses city 1, flights 1-2, 1-4 and 2-4 will exist. If he then chooses city 3, the flight schedule will become complete.
来源
COCI 2016-2017 CONTEST #5