摘要: Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' friends, their friends' friends' friends, and so on), has become an addict 阅读全文
posted @ 2013-05-23 21:45 欧阳生朵 阅读(851) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dragon balls together.His country has N cities and there are exactly N dragon balls in the world. At first, for the ith dragon ba 阅读全文
posted @ 2013-05-23 00:57 欧阳生朵 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。Input输入包括多个测试实例,每个实例包括:第一行有2个正整数n (1<n<=2 阅读全文
posted @ 2013-05-22 21:22 欧阳生朵 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type of pipe. There are 11 types of pipes, which is marked from A to K, as Figure 1 shows 阅读全文
posted @ 2013-05-14 14:52 欧阳生朵 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.There is exactly one node, called the root, to which no directed edges point.Every node e 阅读全文
posted @ 2013-05-14 10:52 欧阳生朵 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的设计图是否符合她的设计思路。比如下面的例子,前两个是符合条件的,但是最后一个却有两种方法从5到达8。Input输入包含多组数据,每组数据是一个以0 0结尾的整数对 阅读全文
posted @ 2013-05-07 21:21 欧阳生朵 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 描述几十年前全世界就流行一种数字扑克游戏,至今仍有人乐此不疲.在中国我们把这种游戏称为“算24点”。您作为游戏者将得到4个1-13(在扑克牌里用A代替1,J代替11,Q代替12,K代替13)之间的自然数作为操作数,而您的任务是对这4个操作数进行适当的算术运算,判断运算结果是否等于24。能输出1,不能输出0。格式输入格式四个牌面值。牌面值与牌面值之间用一个空格隔开。输出格式输出0或1。样例1样例输入1[复制]3 8 10 Q样例输出1[复制]1限制每个测试点1sView Code 1 #include<iostream> 2 #include<stdio.h> 3 #in 阅读全文
posted @ 2013-04-18 12:03 欧阳生朵 阅读(1507) 评论(0) 推荐(0) 编辑
摘要: 胜利大逃亡(续)Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3449Accepted Submission(s): 1111Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。I 阅读全文
posted @ 2013-04-17 13:19 欧阳生朵 阅读(922) 评论(1) 推荐(0) 编辑
摘要: 描述为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看做是平面直角坐标系的第一象限)铺上一些矩形地毯。一共有n张地毯,编号从1到n。现在将这些地毯按照编号从小到大的顺序平行于坐标轴先后铺设,后铺的地毯覆盖在前面已经铺好的地毯之上。地毯铺设完成后,组织者想知道覆盖地面某个点的最上面的那张地毯的编号。注意:在矩形地毯边界和四个顶点上的点也算被地毯覆盖。格式输入格式输入共n+2行。第一行,一个整数n(0 <= n <= 10,000),表示总共有n张地毯。接下来的n行中,第i+1行表示编号i的地毯的信息,包含四个正整数a,b,g,k(0 <= a, b, g, k < 阅读全文
posted @ 2013-04-10 12:28 欧阳生朵 阅读(347) 评论(0) 推荐(1) 编辑
摘要: 描述已知正整数n是两个不同的质数的乘积试求出较大的那个质数。格式输入格式输入只有一行包含一个正整数n。输出格式输出只有一行包含一个正整数p, 即较大的那个质数。样例1样例输入1[复制]21样例输出1[复制]7限制1S提示【数据范围】 对于60%的数据6 ≤ n ≤ 1000。 对于100%的数据6 ≤ n ≤ 2*10的9次方 1 #include<iostream> 2 #include<stdio.h> 3 #include<string.h> 4 #include<cmath> 5 using namespace std; 6 bool 阅读全文
posted @ 2013-04-10 10:40 欧阳生朵 阅读(388) 评论(0) 推荐(0) 编辑