摘要: 从前有一个国王,他叫小鑫。有一天,他想建一座城堡,于是,设计师给他设计了好多简易图纸,主要是房间的连通的图纸。小鑫希望任意两个房间有且仅有一条路径可以相通。小鑫现在把设计图给你,让你帮忙判断设计图是否符合他的想法。比如下面的例子,第一个是符合条件的,但是,第二个不符合,因为从5到4有两条路径(5-3 阅读全文
posted @ 2018-06-17 11:43 Termin 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交 阅读全文
posted @ 2018-06-08 18:34 Termin 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 省政府“畅通工程”的目标是使全省任何两个 阅读全文
posted @ 2018-06-08 18:30 Termin 阅读(156) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-06-04 23:23 Termin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: time limit per test 1 second memory limit per test256 megabytes input standard input output standard output time limit per test 1 second memory limit 阅读全文
posted @ 2018-05-18 17:52 Termin 阅读(332) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; typedef int TelemType; typedef struct BinaryTreeNode { TelemType data; struct BinaryTreeNode *Left; struct BinaryTreeNode *Right; }Node; //创建二叉树,顺序依次为中间... 阅读全文
posted @ 2018-05-04 16:18 Termin 阅读(576) 评论(0) 推荐(0) 编辑
摘要: Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are 阅读全文
posted @ 2018-05-03 20:34 Termin 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Problem Description There are two circles in the plane (shown in the below picture), there is a common area between the two circles. The problem is ea 阅读全文
posted @ 2018-04-27 19:38 Termin 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and 阅读全文
posted @ 2018-04-24 20:34 Termin 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 巴什博弈: Tang and Jiang are good friends. To decide whose treat it is for dinner, they are playing a game. Specifically, Tang and Jiang will alternativel 阅读全文
posted @ 2018-04-22 09:54 Termin 阅读(286) 评论(0) 推荐(0) 编辑