10 2018 档案

摘要:现有村落间道路的统计数据表中,列出了有可能建设成标准公路的若干条道路的成本,求使每个村落都有公路连通所需要的最低成本。 输入格式: 输入数据包括城镇数目正整数N(≤1000)和候选道路数目M(≤3N);随后的M行对应M条道路,每行给出3个正整数,分别是该条道路直接连通的两个城镇的编号以及该道路改建的 阅读全文
posted @ 2018-10-29 16:58 interim 阅读(239) 评论(0) 推荐(0)
摘要:This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of d 阅读全文
posted @ 2018-10-19 09:00 interim 阅读(131) 评论(0) 推荐(0)
摘要:更新了代码,可以了 给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。 输入格式: 输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出 阅读全文
posted @ 2018-10-11 19:18 interim 阅读(860) 评论(0) 推荐(0)
摘要:“六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。 图1 六度空间示意图 “六度空间”理论虽然得到广泛的认同,并且正 阅读全文
posted @ 2018-10-11 18:48 interim 阅读(247) 评论(0) 推荐(0)
摘要:因为自己偶尔会用到,修改注册表什么的, 所以从网上找了代码,便于以后修改. 转存过来. 阅读全文
posted @ 2018-10-09 09:48 interim 阅读(1314) 评论(0) 推荐(0)
摘要:In 1953, David A. Huffman published his paper "A Method for the Construction of Minimum-Redundancy Codes", and hence printed his name in the history o 阅读全文
posted @ 2018-10-05 22:34 interim 阅读(242) 评论(0) 推荐(0)
摘要:将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。 输入格式: 每组测试第1行包含2个正整数N和M(≤1000),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的N个要被插入一个初始为空的小顶堆的整数。 阅读全文
posted @ 2018-10-05 01:47 interim 阅读(165) 评论(0) 推荐(0)
摘要:We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another 阅读全文
posted @ 2018-10-05 01:43 interim 阅读(136) 评论(0) 推荐(0)
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-10-01 14:56 interim 阅读(163) 评论(0) 推荐(0)