摘要: Shaking hands问题描述今天是Gorwin的生日,所以她举办了一个派对并邀请她的朋友来参加。她将邀请n个朋友,为了方便,Gorwin把他们从1到n标号。他们之中有一些人已经相互认识,有一些人不认识对方。相互认识的朋友见面之后会握手然后喝一杯香槟。Gorwin想要知道要准备多少杯香槟。你能帮... 阅读全文
posted @ 2015-05-23 22:57 御心飞行 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 放盘子小度熊喜欢恶作剧。今天他向来访者们提出一个恶俗的游戏。他和来访者们轮流往一个正多边形内放盘子。最后放盘子的是获胜者,会赢得失败者的一个吻。玩了两次以后,小度熊发现来访者们都知道游戏的必胜策略。现在小度熊永远是先手,他想知道他是否能获胜。注意盘子不能相交也不能和多边形相交也不能放在多边形外。就是... 阅读全文
posted @ 2015-05-23 22:55 御心飞行 阅读(248) 评论(2) 推荐(0) 编辑
摘要: 大搬家近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。指示的内容是坐在位置i上的人要搬到位置j上。现在B厂有N个人,一对一到N个位置上。搬家之后也是一一对应的,改变的只有位次。在第一次搬家后,度度熊由于疏忽,又要求大家按照原指示进行了一次搬家。于是,机智的它想到:再按这个指示搬一次家不... 阅读全文
posted @ 2015-05-23 22:50 御心飞行 阅读(231) 评论(0) 推荐(0) 编辑
摘要: IP聚合点击这里Problem Description当今世界,网络已经无处不在了,小度熊由于犯了错误,当上了度度公司的网络管理员,他手上有大量的 IP列表,小度熊想知道在某个固定的子网掩码下,有多少个网络地址。网络地址等于子网掩码与 IP 地址按位进行与运算后的结果,例如:子网掩码:A.B.C.D... 阅读全文
posted @ 2015-05-23 22:44 御心飞行 阅读(293) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k same chara... 阅读全文
posted @ 2015-05-22 13:42 御心飞行 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number of students sit in a circle facing their teacher in the center. Each student initially has an even number of pieces of can... 阅读全文
posted @ 2015-05-21 23:42 御心飞行 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According ... 阅读全文
posted @ 2015-05-21 18:35 御心飞行 阅读(142) 评论(0) 推荐(0) 编辑
摘要: We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou o... 阅读全文
posted @ 2015-05-18 23:36 御心飞行 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA sequence consisting of one digit, the number 1 is initially written into a computer. At each successive time step, the computer s... 阅读全文
posted @ 2015-05-18 17:21 御心飞行 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then... 阅读全文
posted @ 2015-05-13 23:10 御心飞行 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15,... 阅读全文
posted @ 2015-05-12 22:53 御心飞行 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.... 阅读全文
posted @ 2015-05-12 14:43 御心飞行 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).InputInput consists of a sequence o... 阅读全文
posted @ 2015-05-12 00:47 御心飞行 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at wh... 阅读全文
posted @ 2015-05-12 00:14 御心飞行 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircl... 阅读全文
posted @ 2015-05-11 23:54 御心飞行 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA 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 t... 阅读全文
posted @ 2015-05-11 13:19 御心飞行 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guess... 阅读全文
posted @ 2015-05-11 00:14 御心飞行 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of ... 阅读全文
posted @ 2015-05-10 23:17 御心飞行 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 描述在一个3*2的矩形中,可以找到6个1*1的矩形,4个2*1的矩形3个1*2的矩形,2个2*2的矩形,2个3*1的矩形和1个3*2的矩形,总共18个矩形。给出A,B,计算可以从中找到多少个矩形。输入本题有多组输入数据(/*对于3*2矩形,计算为 3*(1+2) 2*(1+2) 1*(1+2),... 阅读全文
posted @ 2015-05-10 01:37 御心飞行 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7)... 阅读全文
posted @ 2015-05-10 01:27 御心飞行 阅读(268) 评论(0) 推荐(0) 编辑