摘要: Problem DescriptionProblems 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 algor. 阅读全文
posted @ 2013-05-01 21:16 forevermemory 阅读(90) 评论(0) 推荐(0) 编辑
摘要: DescriptionA lattice point (x, y) in the first quadrant (x and y are integers greater than or equal to 0), other than the origin, is visible from the origin if the line from (0, 0) to (x, y) does not pass through any other lattice point. For example, the point (4, 2) is not visible since the line fr 阅读全文
posted @ 2013-05-01 19:31 forevermemory 阅读(253) 评论(0) 推荐(0) 编辑
摘要: DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy and b = xz.InputThere are several test cases. For each test case, standard input 阅读全文
posted @ 2013-05-01 16:58 forevermemory 阅读(258) 评论(0) 推荐(0) 编辑