2013年2月25日
摘要: Problem EAll in AllInput:standard inputOutput:standard outputTime Limit:2 secondsMemory Limit:32 MBYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss 阅读全文
posted @ 2013-02-25 15:45 LOVE小熊ing 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Skew BinaryWhen a number is expressed in decimal, thek-th digit represents a multiple of 10k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,When a number is expressed in binary, thek-th digit represents a multiple of 2k. For example,Inskew binar 阅读全文
posted @ 2013-02-25 15:40 LOVE小熊ing 阅读(265) 评论(0) 推荐(0) 编辑
摘要: The Collatz SequenceAn algorithm given by Lothar Collatz produces sequences of integers, and is described as follows:Step 1:Choose an arbitrary positive integerAas the first item in the sequence.Step 2:IfA= 1 then stop.Step 3:IfAis even, then replaceAbyA/ 2 and go to step 2.Step 4:IfAis odd, then re 阅读全文
posted @ 2013-02-25 11:39 LOVE小熊ing 阅读(349) 评论(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-25 11:36 LOVE小熊ing 阅读(185) 评论(0) 推荐(0) 编辑
  2013年2月24日
摘要: 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-24 17:11 LOVE小熊ing 阅读(197) 评论(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-24 00:21 LOVE小熊ing 阅读(212) 评论(0) 推荐(0) 编辑
  2013年2月23日
摘要: 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-23 23:37 LOVE小熊ing 阅读(434) 评论(0) 推荐(0) 编辑
摘要: Problem D: Beat the Spread!Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunctions, the local hackers have organized a betting pool on the game. Members place their bets on the sum of the two final scores, or on the absolute differen 阅读全文
posted @ 2013-02-23 17:40 LOVE小熊ing 阅读(444) 评论(0) 推荐(0) 编辑
摘要: Problem BPeter’s SmokesInput:standard inputOutput:standard outputTime Limit:4 secondsMemory Limit:32 MBPeter hasncigarettes. He smokes them one by one keeping all the butts. Out ofk> 1butts he can roll a new cigarette.How many cigarettes can Peter have?InputInput is a sequence of lines. Each line 阅读全文
posted @ 2013-02-23 14:20 LOVE小熊ing 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Problem AEcological PremiumInput:standard inputOutput:standard outputTime Limit:1 secondMemory Limit:32 MBGerman farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meters an 阅读全文
posted @ 2013-02-23 00:05 LOVE小熊ing 阅读(130) 评论(0) 推荐(0) 编辑