摘要:
从前有一个国王,他叫小鑫。有一天,他想建一座城堡,于是,设计师给他设计了好多简易图纸,主要是房间的连通的图纸。小鑫希望任意两个房间有且仅有一条路径可以相通。小鑫现在把设计图给你,让你帮忙判断设计图是否符合他的想法。比如下面的例子,第一个是符合条件的,但是,第二个不符合,因为从5到4有两条路径(5-3 阅读全文
摘要:
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交 阅读全文
摘要:
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 省政府“畅通工程”的目标是使全省任何两个 阅读全文
摘要:
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 阅读全文
摘要:
#include using namespace std; typedef int TelemType; typedef struct BinaryTreeNode { TelemType data; struct BinaryTreeNode *Left; struct BinaryTreeNode *Right; }Node; //创建二叉树,顺序依次为中间... 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
巴什博弈: 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 阅读全文