摘要: Dissatisfying LiftTime Limit: 1000MSMemory Limit:10000KTotal Submissions: 4721Accepted:1013DescriptionThere's a building with M floors. The amounts of tenants of every floor are K1, K2, K3, ..., Km. One day all the tenants went home together and they took the same lift (suppose the lift was larg 阅读全文
posted @ 2011-11-21 22:33 w0w0 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Sorting by SwappingTime Limit: 1000MSMemory Limit:10000KTotal Submissions: 8109Accepted:4300DescriptionGiven a permutation of numbers from 1 to n, we can always get the sequence 1, 2, 3, ..., n by swapping pairs of numbers. For example, if the initial sequence is 2, 3, 5, 4, 1, we can sort them in t 阅读全文
posted @ 2011-11-21 22:32 w0w0 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Biker's Trip OdometerTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4743 Accepted: 3032DescriptionMost bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spokes on the front wheel so that it will line u 阅读全文
posted @ 2011-11-21 22:30 w0w0 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 放苹果Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19066 Accepted: 12079Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3 1: #include<iost 阅读全文
posted @ 2011-11-21 21:26 w0w0 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Number StepsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11605 Accepted: 6167DescriptionStarting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1) respect 阅读全文
posted @ 2011-11-21 21:25 w0w0 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Eva's ProblemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 14397 Accepted: 8705DescriptionEva的家庭作业里有很多数列填空练习。填空练习的要求是:已知数列的前四项,填出第五项。因为已经知道这些数列只可能是等差或等比数列,她决定写一个程序来完成这些练习。Input第一行是数列的数目t(0 <= t <= 20)。以下每行均包含四个整数,表示数列的前四项。约定数列的前五项均为不大于10^5的自然数,等比数列的比值也是自然数。Output对输入的每个数列,输出它的前五 阅读全文
posted @ 2011-11-21 21:24 w0w0 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Distance on ChessboardTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19434 Accepted: 6745Description国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。如下图所示:王、后、车、象的走子规则如下:王:横、直、斜都可以走,但每步限走一格。后:横、直、斜都可以走,每步格数不受限制。车:横、竖均可以走,不能斜走,格数不限。象:只能斜走,格数不限。写一个程序,给定起始位置和目标位置,计算王、后、车、象从起始位置走到目标位置所需的最少步数。Input第一行是测试数据的组数t( 阅读全文
posted @ 2011-11-21 21:23 w0w0 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Counting BlackTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8396 Accepted: 5398DescriptionThere is a board with 100 * 100 grids as shown below. The left-top gird is denoted as (1, 1) and the right-bottom grid is (100, 100).We may apply three commands to the board:1. WHITE x, y, L //... 阅读全文
posted @ 2011-11-21 21:21 w0w0 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Just the FactsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7334 Accepted: 3881DescriptionThe expression N!, read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example, N N! 0 1 1 1 2 2 3 6 4 ... 阅读全文
posted @ 2011-11-21 21:20 w0w0 阅读(199) 评论(0) 推荐(0) 编辑
摘要: A Contesting DecisionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1748 Accepted: 1288DescriptionJudging a programming contest is hard work, with demanding contestants, tedious decisions,and monotonous work. Not to mention the nutritional problems of spending 12 hours with only donuts, p 阅读全文
posted @ 2011-11-21 21:19 w0w0 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Function Run FunTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11932 Accepted: 6255DescriptionWe all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c): if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns: 1 if a > 20 or b > 20 or c &g 阅读全文
posted @ 2011-11-21 21:18 w0w0 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Easier Done Than Said?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3333 Accepted: 1833DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated pas 阅读全文
posted @ 2011-11-21 21:16 w0w0 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Haiku ReviewTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 647 Accepted: 393DescriptionHaiku is an ancient form of Japanese poetry. A haiku is a three-line poem with seventeen syllables, where the first line must contain five syllables, the second line must contain seven syllables, and th 阅读全文
posted @ 2011-11-21 21:15 w0w0 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Skew BinaryTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 8958 Accepted: 5721DescriptionWhen a number is expressed in decimal, the kth digit represents a multiple of 10k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example, 81307(10) = 8 * 阅读全文
posted @ 2011-11-21 21:14 w0w0 阅读(165) 评论(0) 推荐(0) 编辑
摘要: DoublesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15059 Accepted: 8519DescriptionAs part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some 阅读全文
posted @ 2011-11-21 20:29 w0w0 阅读(228) 评论(0) 推荐(0) 编辑