02 2013 档案

10929 - You can say 11
摘要:Introduction to the problemYour job is, given a positive number N, determine if it is a multiple of eleven.Description of the inputThe input is a file such that each line contains a positive number. A line containing the number 0 is the end of the input. The given numbers can contain up to 1000 digi 阅读全文

posted @ 2013-02-22 20:36 喂喂还债啦 阅读(325) 评论(0) 推荐(0)

11879 - Multiple of 17
摘要:Theorem: If you drop the last digit d of an integer n (n10), subtract 5d from the remaining integer, then the difference is a multiple of 17 if and only if n is a multiple of 17.For example, 34 is a multiple of 17, because 3-20=-17 is a multiple of 17; 201 is not a multiple of 17, because 20-5=15 is 阅读全文

posted @ 2013-02-22 20:03 喂喂还债啦 阅读(434) 评论(0) 推荐(0)

11689 - Soda Surpler
摘要:Tim is an absolutely obsessive soda drinker, he simply cannot get enough. Most annoyingly though, he almost never has any money, so his only obvious legal way to obtain more soda is to take the money he gets when he recycles empty soda bottles to buy new ones. In addition to the empty bottles result 阅读全文

posted @ 2013-02-22 19:03 喂喂还债啦 阅读(496) 评论(0) 推荐(0)

11332 - Summing Digits
摘要:For a positive integer n, let f(n) denote the sum of the digits of n when represented in base 10. It is easy to see that the sequence of numbers n, f(n), f(f(n)), f(f(f(n))), ... eventually becomes a single digit number that repeats forever. Let this single digit be denoted g(n).For example, conside 阅读全文

posted @ 2013-02-19 20:25 喂喂还债啦 阅读(796) 评论(0) 推荐(0)

11494 - Queen
摘要:The ProblemThe game of Chess has several pieces with curious movements. One of them is the Queen, which can move any number of squares in any direction: in the same line, in the same column or in any of the diagonals, as illustrated by the figure below (black dots represent positions the queen may r 阅读全文

posted @ 2013-02-19 18:54 喂喂还债啦 阅读(837) 评论(0) 推荐(0)

11498 - Division of Nlogonia
摘要:The ProblemAfter centuries of hostilities and skirmishes between the four nations living in the land generally known as Nlogonia, and years of negotiations involving diplomats, politicians and the armed forces of all interested parties, with mediation by UN, NATO, G7 and SBC, it was at last agreed b 阅读全文

posted @ 2013-02-18 11:25 喂喂还债啦 阅读(316) 评论(0) 推荐(0)

11743 - Credit Check
摘要:These days, it has become commonplace to make purchases over the internet using a credit card. However, because credit card numbers are relatively long, it is easy to make a mistake while typing them in. In order to quickly identify errors like typos, most e-commerce websites use a checksum algorith 阅读全文

posted @ 2013-02-18 11:11 喂喂还债啦 阅读(590) 评论(0) 推荐(0)

11764 - Jumping Mario
摘要:Mario is in the final castle. He now needs to jump over few walls and then enter the Koopa’s Chamber where he has to defeat the monster in order to save the princess. For this problem, we are only concerned with the “jumping over the wall” part. You will be given the heights of N walls from left to 阅读全文

posted @ 2013-02-17 13:21 喂喂还债啦 阅读(1063) 评论(0) 推荐(0)

11875 - Brick Game
摘要:There is a village in Bangladesh, where brick game is very popular. Brick game is a team game. Each team consists of odd number of players. Number of players must be greater than 1 but cannot be greater than 10. Age of each player must be within 11 and 20. No two players can have the same age. There 阅读全文

posted @ 2013-02-17 13:04 喂喂还债啦 阅读(357) 评论(0) 推荐(0)

11936 - The Lazy Lumberjacks
摘要:Once upon a time in a far, far away forest, there was a team of lazy lumberjacks. Since they were too lazy to cut trees, they were always figuring out ways to sneak out of work. Their foreman, on the other side, was always trying to put them all to work.After a lot of discussions the foreman and the 阅读全文

posted @ 2013-02-17 11:44 喂喂还债啦 阅读(329) 评论(0) 推荐(0)

11942 - Lumberjack Sequencing
摘要:Another tale of lumberjacks?. Let see ...The lumberjacks are rude, bearded workers, while foremen tend to be bossy and simpleminded. The foremen like to harass the lumberjacks by making them line up in groups of ten, ordered by the length of their beards. The lumberjacks, being of different physical 阅读全文

posted @ 2013-02-17 11:31 喂喂还债啦 阅读(597) 评论(0) 推荐(0)

11984 - A Change in Thermal Unit
摘要:Measuring temperature and temperature differences are common task in many research and applications. Unfortunately, there exists more than one unit of measuring temperatures. This introduces a lot of confusion at times. Two popular units of measurements are Celsius(C) and Fahrenheit (F). The convers 阅读全文

posted @ 2013-02-16 21:19 喂喂还债啦 阅读(265) 评论(0) 推荐(0)

12019 - Doom's Day Algorithm
摘要:BackgroundNo. Doom's day algorithm is not a method to compute which day the world will end. It is an algorithm created by the mathematician John Horton Conway, to calculate which day of the week (Monday, Tuesday, etc.) corresponds to a certain date.This algorithm is based in the idea of thedooms 阅读全文

posted @ 2013-02-16 20:44 喂喂还债啦 阅读(300) 评论(0) 推荐(0)

12149 - Feynman
摘要:Richard Phillips Feynman was a well known American physicist and a recipient of the Nobel Prize in Physics. He worked in theoretical physics and also pioneered the field of quantum computing. He visited South America for ten months, giving lectures and enjoying life in the tropics. He is also known 阅读全文

posted @ 2013-02-08 19:54 喂喂还债啦 阅读(279) 评论(0) 推荐(0)

12459 - Bees' ancestors
摘要:BackgroundMaya is a bee that likes to help her friends. Willy is a drone bee and Maya's best friend. He has just discovered that he has no father, and he is worried about that.The drone bee Willy.The ProblemMaya knows that female bees have two parents (one father and one mother), but male or dro 阅读全文

posted @ 2013-02-08 19:23 喂喂还债啦 阅读(327) 评论(0) 推荐(0)

12468 - Zapping
摘要:I’m a big fan of watching TV. However, I don’t like to watch a single channel; I’m constantly zapping between different channels. My dog tried to eat my remote controller and unfortunately he partially destroyed it. The numeric buttons I used to press to quickly change channels are not working anymo 阅读全文

posted @ 2013-02-08 18:56 喂喂还债啦 阅读(578) 评论(0) 推荐(0)

11479 - Is this the easiest problem?
摘要:A triangle is a geometric shape with three positive sides. However, any given three sides won’t necessarily form a triangle. The three sides must form a closed region. Triangles are categorized depending on the values of the sides of a valid triangle. In this problem you are required to determine th 阅读全文

posted @ 2013-02-08 11:53 喂喂还债啦 阅读(473) 评论(0) 推荐(0)

11364 - Parking
摘要:When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help Michael choose a place to park which minimises the distance he needs to walk on his shopping round? <TEX2HTML_VERBATIM_MARK>Long Street is a straight line, w 阅读全文

posted @ 2013-02-08 10:41 喂喂还债啦 阅读(826) 评论(0) 推荐(0)

11185 - Ternary
摘要:You will be given a decimal number. You will have to convert it to its ternary (Base 3) equivalent.InputThe input file contains at most 100 lines of inputs. Each line contains a non-negative decimal integer N(N<1000000001). Input is terminated by a line containing a negative value. This line shou 阅读全文

posted @ 2013-02-07 11:32 喂喂还债啦 阅读(236) 评论(0) 推荐(0)

11172 - Relational Operator
摘要:Some operators checks about the relationship between two values and these operators are called relational operators. Given two numerical values your job is just to find out the relationship between them that is (i) First one is greater than the second (ii) First one is less than the second or (iii) 阅读全文

posted @ 2013-02-07 10:55 喂喂还债啦 阅读(261) 评论(0) 推荐(0)

10783 - Odd Sum
摘要:Given a range [a, b], you are to find the summation of all the odd integers in this range. For example, the summation of all the odd integers in the range [3, 9] is3 + 5 + 7 + 9 = 24.InputThere can be at multiple test cases. The first line of input gives you the number of test cases, T (1T100). Then 阅读全文

posted @ 2013-02-06 12:35 喂喂还债啦 阅读(898) 评论(0) 推荐(0)

10696 - f91
摘要:BackgroundMcCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integer N and returns a positive integer defined as follows:If N ≤ 100, then f91(N) = f91(f91(N+11));If N ≥ 101, then f91(N) = N-10.The ProblemWrite 阅读全文

posted @ 2013-02-06 12:20 喂喂还债啦 阅读(411) 评论(0) 推荐(0)

488 - Triangle Wave
摘要:In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed 阅读全文

posted @ 2013-02-06 11:04 喂喂还债啦 阅读(283) 评论(0) 推荐(0)

10370 - Above Average
摘要:It is said that 90% of frosh expect to be above average in their class. You are to provide a reality check.The first line of standard input contains an integer C, the number of test cases. C data sets follow. Each data set begins with an integer, N, the number of people in the class (1 <= N <= 阅读全文

posted @ 2013-02-05 20:09 喂喂还债啦 阅读(469) 评论(0) 推荐(0)

10082 - WERTYU
摘要:A 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 lines of text. Each l 阅读全文

posted @ 2013-02-05 15:51 喂喂还债啦 阅读(306) 评论(0) 推荐(0)

10222 - Decode the Mad man
摘要:The ProblemOnce in BUET, an old professor had gone completely mad. He started talking with some peculiar words. Nobody could realize his speech and lectures. Finally the BUET authority fall in great trouble. There was no way left to keep that man working in university. Suddenly a student (definitely 阅读全文

posted @ 2013-02-05 15:34 喂喂还债啦 阅读(922) 评论(0) 推荐(0)

913 - Joana and the Odd Numbers
摘要:Joana loves playing with odd numbers. In the other day, she started writing, in each line, an odd number of odd numbers. It looked as follows: 1 3 5 7 9 11 13 15 1719 21 23 25 27 29 31...On a certain line Joana wrote 55 odd numbers. Can you discover the sum of the last three numbers written in tha.. 阅读全文

posted @ 2013-02-05 10:22 喂喂还债啦 阅读(493) 评论(0) 推荐(0)

591 - Box of Bricks
摘要:Little 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.'', she re 阅读全文

posted @ 2013-02-05 09:52 喂喂还债啦 阅读(1777) 评论(0) 推荐(0)

272 - TEX Quotes
摘要:TeX 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 most keyb 阅读全文

posted @ 2013-02-04 20:22 喂喂还债啦 阅读(1070) 评论(0) 推荐(0)

10035 - Primary Arithmetic
摘要:Children 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 carry operations for each of 阅读全文

posted @ 2013-02-03 23:10 喂喂还债啦 阅读(1091) 评论(0) 推荐(0)

10038 - Jolly Jumpers
摘要:A 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 definition implies that any s 阅读全文

posted @ 2013-02-03 11:19 喂喂还债啦 阅读(273) 评论(0) 推荐(0)

102 - Ecological Bin Packing
摘要:BackgroundBin 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 optimal heuristic solution 阅读全文

posted @ 2013-02-03 09:41 喂喂还债啦 阅读(361) 评论(0) 推荐(0)

100 - The 3n + 1 problem
摘要:BackgroundProblems 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 the following algo 阅读全文

posted @ 2013-02-01 09:45 喂喂还债啦 阅读(160) 评论(0) 推荐(0)