摘要: 六度分离Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1271Accepted Submission(s): 488Problem Description1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degree 阅读全文
posted @ 2012-05-22 15:57 mtry 阅读(238) 评论(0) 推荐(0)
摘要: Data EncodingAccepted : 14Submit : 118Time Limit : 1000 MSMemory Limit : 1048576 KBData EncodingGiven a string S, your job is to encode it into a new string T using given charset C. To make the decoding easy, each original character X in S is encoded into a string Y made up of characters in C. What& 阅读全文
posted @ 2012-05-20 08:36 mtry 阅读(230) 评论(0) 推荐(0)
摘要: 1024: MiningTime Limit: 1 SecMemory Limit: 128 MBSUBMIT: 14Solved: 4[SUBMIT][STATUS]DescriptionZfy and Kevin are friends and they like to go mining together at some place in the university. About at 6 p.m. they start to feel tired and want to go to dormitory. They want to get to dormitory quickly so 阅读全文
posted @ 2012-05-17 13:49 mtry 阅读(312) 评论(0) 推荐(0)
摘要: Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3466Accepted Submission(s): 2113Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文
posted @ 2012-05-16 09:00 mtry 阅读(567) 评论(0) 推荐(0)
摘要: I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14377Accepted Submission(s): 5570Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个 阅读全文
posted @ 2012-05-14 18:45 mtry 阅读(254) 评论(0) 推荐(0)
摘要: Zombie’s Treasure ChestTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1708Accepted Submission(s): 357Problem DescriptionSome brave warriors come to a lost village. They are very lucky and find a lot of treasures and a big treasure chest, but with 阅读全文
posted @ 2012-05-11 15:25 mtry 阅读(1114) 评论(9) 推荐(0)
摘要: Big NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14952Accepted Submission(s): 6631Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, 阅读全文
posted @ 2012-05-07 15:01 mtry 阅读(1959) 评论(0) 推荐(0)
摘要: Hat's FibonacciTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3442Accepted Submission(s): 1169Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 阅读全文
posted @ 2012-05-07 11:37 mtry 阅读(818) 评论(0) 推荐(0)
摘要: A + B Problem IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 111273Accepted Submission(s): 21079Problem 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 @ 2012-05-07 09:44 mtry 阅读(2357) 评论(0) 推荐(0)
摘要: Eddy's pictureTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3651Accepted Submission(s): 1793Problem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his smal 阅读全文
posted @ 2012-05-05 09:34 mtry 阅读(168) 评论(0) 推荐(0)
摘要: Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6701Accepted Submission(s): 2475Problem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to e 阅读全文
posted @ 2012-05-05 08:32 mtry 阅读(1853) 评论(2) 推荐(1)
摘要: 还是畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12633Accepted Submission(s): 5811Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用 阅读全文
posted @ 2012-05-04 21:12 mtry 阅读(328) 评论(0) 推荐(0)
摘要: 畅通工程 Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14969Accepted Submission(s): 7702Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第. 阅读全文
posted @ 2012-05-04 19:28 mtry 阅读(364) 评论(0) 推荐(0)
摘要: Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 56345Accepted Submission(s): 12756Problem 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 to 阅读全文
posted @ 2012-05-03 13:53 mtry 阅读(790) 评论(0) 推荐(0)
摘要: Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12105Accepted Submission(s): 5497Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of nu 阅读全文
posted @ 2012-04-29 00:39 mtry 阅读(1285) 评论(0) 推荐(0)
摘要: SafecrackerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3966Accepted Submission(s): 2028Problem Description=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Kle 阅读全文
posted @ 2012-04-28 23:52 mtry 阅读(3046) 评论(0) 推荐(3)
摘要: Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33445Accepted Submission(s): 9015Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, a 阅读全文
posted @ 2012-04-28 19:58 mtry 阅读(9126) 评论(1) 推荐(2)
摘要: Little Bishops A bishop is a piece used in the game of chess which can only move diagonally from its current position. Two bishops attack each other if one is on the path of the other. In the figure below, the dark squares represent the reachable locations for bishop B1 from its current position. Bi 阅读全文
posted @ 2012-04-27 00:16 mtry 阅读(918) 评论(0) 推荐(0)
摘要: The Tourist Guide Mr. G. works as a tourist guide in Bangladesh. His current assignment is to show a group of tourists a distant city. As in all countries, certain pairs of cities are connected by two-way roads. Each pair of neighboring cities has a bus service that runs only between those two citie 阅读全文
posted @ 2012-04-26 00:34 mtry 阅读(302) 评论(0) 推荐(0)
摘要: Playing with Wheels Consider the following mathematical machine. Digits ranging from 0 to 9 are printed consecutively (clockwise) on the periphery of each wheel. The topmost digits of the wheels form a four-digit integer. For example, in the following figure the wheels form the integer 8,056. Each w 阅读全文
posted @ 2012-04-25 14:15 mtry 阅读(356) 评论(0) 推荐(0)