摘要: Box of BricksLittle Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. ``Look, I've built a wall!'', he tells his older sister Alice. ``Nah, you should make all stacks the same height. Then you would have a real wall.' 阅读全文
posted @ 2013-02-21 00:52 三人木君 阅读(219) 评论(0) 推荐(0)
摘要: Problem C: WERTYUA common typing error is to place the hands on the keyboard one row to the right of the correct position. So "Q" is typed as "W" and "J" is typed as "K" and so on. You are to decode a message typed in this manner.Input consists of several line 阅读全文
posted @ 2013-02-21 00:11 三人木君 阅读(216) 评论(0) 推荐(0)
摘要: Train SwappingAt an old railway station, you may still encounter one of the last remaining ``train swappers''. A train swapper is an employee of the railroad, whose sole job it is to rearrange the carriages of trains.Once the carriages are arranged in the optimal order, all the train driver 阅读全文
posted @ 2013-02-20 23:46 三人木君 阅读(238) 评论(0) 推荐(0)
摘要: Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInput to your program will consist of a series of lines, each line containing multiple words (at least one 阅读全文
posted @ 2013-02-20 21:48 三人木君 阅读(493) 评论(0) 推荐(0)
摘要: Power of CryptographyBackgroundCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers modulo functions of these primes. Work in this area has resulted in the practical use of results from number theory and other branches of mathematics once con 阅读全文
posted @ 2013-02-20 17:42 三人木君 阅读(684) 评论(0) 推荐(0)
摘要: Maximum SumBackgroundA problem that is simple to solve in one dimension is often much more difficult to solve in more than one dimension. Consider satisfying a boolean expression in conjunctive normal form in which each conjunct consists of exactly 3 disjuncts. This problem (3-SAT) is NP-complete. T 阅读全文
posted @ 2013-02-20 17:24 三人木君 阅读(446) 评论(0) 推荐(0)
摘要: Ugly NumbersUgly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the first 11 ugly numbers. By convention, 1 is included.Write a program to find and print the 1500'th ugly number.Input and OutputThere is no input to this progra 阅读全文
posted @ 2013-02-20 02:51 三人木君 阅读(3602) 评论(0) 推荐(0)
摘要: Reverse and AddThe ProblemThe "reverse and add" method is simple: choose a number, reverse its digits and add it to the original. If the sum is not a palindrome (which means, it is not the same number from left to right and right to left), repeat this procedure.For example: 195 Initial num 阅读全文
posted @ 2013-02-20 02:06 三人木君 阅读(474) 评论(0) 推荐(0)
摘要: Problem B: Primary ArithmeticChildren are taught to add multi-digit numbers from right-to-left one digit at a time. Many find the "carry" operation - in which a 1 is carried from one digit position to be added to the next - to be a significant challenge. Your job is to count the number of 阅读全文
posted @ 2013-02-16 16:33 三人木君 阅读(534) 评论(0) 推荐(0)
摘要: Problem E: Jolly JumpersA sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1. For instance,1 4 2 3is a jolly jumper, because the absolutes differences are 3, 2, and 1 respectively. The defin 阅读全文
posted @ 2013-02-07 02:25 三人木君 阅读(474) 评论(0) 推荐(0)
摘要: 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-05 21:53 三人木君 阅读(249) 评论(0) 推荐(0)
摘要: TeX QuotesTeX is a typesetting language developed by Donald Knuth. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document. Beautiful documents use `` and " to delimit quotations, rather than the mundane " which is what is provided by 阅读全文
posted @ 2013-02-04 17:25 三人木君 阅读(520) 评论(0) 推荐(0)
摘要: Problem AHashmat the brave warrior Input: 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 t 阅读全文
posted @ 2013-02-04 17:15 三人木君 阅读(216) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2013-02-04 16:56 三人木君 阅读(221) 评论(0) 推荐(0)
摘要: Ecological Bin PackingBackgroundBin packing, or the placement of objects of certain weights into different bins subject to certain constraints, is an historically interesting problem. Some bin packing problems are NP-complete but are amenable to dynamic programming solutions or to approximately opti 阅读全文
posted @ 2013-02-04 16:45 三人木君 阅读(354) 评论(0) 推荐(0)
摘要: 100 - The 3n + 1 problemTime limit: 3.000 secondsThe 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 k 阅读全文
posted @ 2013-02-02 14:18 三人木君 阅读(1966) 评论(0) 推荐(0)