2013年2月5日
摘要: Problem A - f91Time Limit: 1 secondBackgroundMcCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integerNand returns a positive integer defined as follows:IfN ≤ 100, then f91(N) = f91(f91(N+11));IfN ≥ 101, then 阅读全文
posted @ 2013-02-05 21:18 LOVE小熊ing 阅读(154) 评论(0) 推荐(0) 编辑
  2013年2月1日
摘要: The DecoderWrite a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character s 阅读全文
posted @ 2013-02-01 23:41 LOVE小熊ing 阅读(219) 评论(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 t 阅读全文
posted @ 2013-02-01 16:30 LOVE小熊ing 阅读(159) 评论(0) 推荐(0) 编辑
  2013年1月29日
摘要: Problem BBack to High School PhysicsInput:standard inputOutput:standard outputA particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?InputThe input will contain two integers in each line. Each line m 阅读全文
posted @ 2013-01-29 22:40 LOVE小熊ing 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Problem AHashmat the brave warriorInput:standard inputOutput:standard outputHashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the 阅读全文
posted @ 2013-01-29 21:02 LOVE小熊ing 阅读(129) 评论(0) 推荐(0) 编辑