HDOJ 1008Elevator

摘要: Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The 阅读全文
posted @ 2013-03-19 21:23 喂喂还债啦 阅读(368) 评论(0) 推荐(0) 编辑

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 喂喂还债啦 阅读(316) 评论(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 喂喂还债啦 阅读(411) 评论(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 喂喂还债啦 阅读(486) 评论(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 喂喂还债啦 阅读(759) 评论(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 喂喂还债啦 阅读(763) 评论(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 喂喂还债啦 阅读(310) 评论(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 喂喂还债啦 阅读(577) 评论(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 喂喂还债啦 阅读(1038) 评论(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 喂喂还债啦 阅读(345) 评论(0) 推荐(0) 编辑