摘要: Sum square differenceProblem 6The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2 = 552 = 3025Hence the difference between the sum of the squares of the first ten natural numbers and the squ 阅读全文
posted @ 2013-05-28 21:54 楼兰故居 阅读(97) 评论(0) 推荐(0)
摘要: 还是畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18878Accepted Submission(s): 8388Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用 阅读全文
posted @ 2013-05-28 17:25 楼兰故居 阅读(120) 评论(0) 推荐(0)
摘要: Light, more lightThe ProblemThere is man named "mabu" for switching on-off light in our University. He switches on-off the lights in a corridor. Every bulb has its own toggle switch. That is, if it is pressed then the bulb turns on. Another press will turn it off. To save power consumption 阅读全文
posted @ 2013-05-15 17:16 楼兰故居 阅读(169) 评论(0) 推荐(0)
摘要: Problem B: MinesweeperThe ProblemHave you ever played Minesweeper? It's a cute little game which comes within a certain Operating System which name we can't really remember. Well, the goal of the game is to find where are all the mines within a MxN field. To help you, the game shows a number 阅读全文
posted @ 2013-05-15 12:42 楼兰故居 阅读(181) 评论(0) 推荐(0)
摘要: The 3n + 1 problemBackgroundProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.The ProblemConsider 阅读全文
posted @ 2013-05-14 21:33 楼兰故居 阅读(129) 评论(0) 推荐(0)
摘要: Street NumbersA computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turning left or right and walking to the end of the street and back. One night she adds up the street numbe 阅读全文
posted @ 2013-05-07 20:18 楼兰故居 阅读(209) 评论(0) 推荐(0)
摘要: 小A家里有很多长度不一样的木棍,有一天他很无聊,只能摆弄这些木棒来解闷了。小A的数学学得很好,所以他想在这些木棒中挑出3根来组成一个直角三角形,当然,他有可能有很多种选法,所以他还想挑出一个面积最大的。 阅读全文
posted @ 2013-01-24 14:08 楼兰故居 阅读(482) 评论(0) 推荐(0)