摘要: Problem D: ShellSortHe made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful view! He could see 'most a mile!The ProblemKing Yertle wishes to rearrange his turtle throne to place his hi 阅读全文
posted @ 2014-01-31 10:02 ~~Snail~~ 阅读(320) 评论(0) 推荐(0)
摘要: Parentheses BalanceYou are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and B are correct, AB is correct,(c)if A is correct,(A)and[A]is correct.Write a program that takes a sequence of strings of this type and check t 阅读全文
posted @ 2014-01-31 09:45 ~~Snail~~ 阅读(380) 评论(0) 推荐(0)
摘要: Inscribed Circles and Isosceles TrianglesGiven two real numbersBthe width of the base of an isosceles triangle in inchesHthe altitude of the same isosceles triangle in inchesCompute to six significant decimal placesCthe sum of the circumferences of a series of inscribed circles stacked one on top of 阅读全文
posted @ 2014-01-31 09:36 ~~Snail~~ 阅读(207) 评论(0) 推荐(0)
摘要: Problem EThe Other Two TreesInput:standard inputOutput:standard outputTime Limit:2 secondsYou have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, thatmeansyou have a common fence with all of them. F 阅读全文
posted @ 2014-01-31 09:12 ~~Snail~~ 阅读(265) 评论(0) 推荐(0)
摘要: Problem BCode RefactoringTime Limit: 2 seconds"Harry, my dream is a code waiting to bebroken. Break the code, solve the crime."Agent CooperSeveral algorithms in modern cryptography are based on the fact that factoring large numbers is difficult. Alicia and Bobby know this, so they have dec 阅读全文
posted @ 2014-01-31 08:56 ~~Snail~~ 阅读(178) 评论(0) 推荐(0)
摘要: Problem F: Factoring Large NumbersOne of the central ideas behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 digit number that was a product of two 50 digit prime numbers. Even with the fastest projected computers this factoriz 阅读全文
posted @ 2014-01-31 08:46 ~~Snail~~ 阅读(242) 评论(0) 推荐(0)