摘要: The 3n + 1 problem Time Limit: 1000MS Memory Limit: 10000K Description Problems 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. Consider the following algorithm: 1. input n 2. print n 3. if n = 1 then STOP 4. if n is odd then n 阅读全文
posted @ 2013-03-02 19:10 Cocoon 阅读(569) 评论(0) 推荐(0) 编辑
摘要: THE DRUNK JAILER Time Limit: 1000MS Memory Limit: 10000K Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night, the jailer gets bored and decides to play a game. For round 1 of the game, he takes a drink of whiskey,and then runs down the hall unlocking each cell. For round 2, he takes a drink of whiskey, and then runs down the hall locking every other cell (c 阅读全文
posted @ 2013-03-02 00:14 Cocoon 阅读(435) 评论(0) 推荐(0) 编辑