
并查集
YRZ-James
who say you are not perfect?
展开
-
畅通工程
题目: 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给...原创 2019-01-26 09:33:33 · 98 阅读 · 0 评论 -
The Suspects
题目: 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 strategy is ...原创 2019-01-26 20:55:23 · 235 阅读 · 0 评论 -
Ubiquitous Religions
题目: There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university ...原创 2019-01-26 22:23:36 · 418 阅读 · 0 评论