并查集||欧拉回路
reb0rn初代
弃疗吧
展开
-
The Suspects
Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best stra原创 2016-08-01 21:26:25 · 239 阅读 · 0 评论 -
How Many Tables
D - How Many TablesDescription Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all原创 2016-08-01 21:28:34 · 227 阅读 · 0 评论 -
More is better
More is betterDescription Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements原创 2016-08-01 21:31:23 · 201 阅读 · 0 评论 -
欧拉回路
欧拉回路Description 欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 < N < 1000 )和边数M;随后的M行对应M条边,每行给出一对正整数,分别是该条边直接连通的两个节点的编号(节点从1到N编号)。当N为0时输入结原创 2016-08-01 21:33:54 · 271 阅读 · 0 评论 -
畅通工程
Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条原创 2016-08-01 21:23:11 · 195 阅读 · 0 评论