摘要: Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how t 阅读全文
posted @ 2013-07-16 19:41 15HP_EPM测试4_王晓 阅读(155) 评论(3) 推荐(0) 编辑
摘要: 题目描述:某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?解题思路:此处涉及到数据结构中的并查集。解题C语言代码: 1#include 2 3 int father[1001]; 4 5 int Find_father(int n) 6 7 { 8 9 if(father[n] != n) father[n]=Find_father(father[n]);1011 return father[n];... 阅读全文
posted @ 2013-07-16 19:25 15HP_EPM测试4_王晓 阅读(215) 评论(0) 推荐(0) 编辑