- 博客(24)
- 收藏
- 关注
原创 UVa 127 "Accordian" Patience
DescriptionYou are to simulate the playing of games of ``Accordian'' patience, the rules for which are as follows:Deal cards one by one in a row from left to right, not overlapping. Whenever t
2015-07-22 14:02:05
387
原创 UVa10037 Bridge
n people wish to cross a bridge at night. A group of at most two people may cross at any time, and each group must have a flashlight. Only one flashlight is available among the n people, so some sor
2015-07-19 15:37:50
428
原创 UVA 10036 Divisibility
Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different values. Let us,
2015-07-16 17:20:25
347
原创 UVa123 Searching Quickly
DescriptionBackgroundSearching and sorting are part of the theory and practice of computer science. For example, binary search provides a good example of an easy-to-understand algorithm with
2015-07-12 14:59:59
334
原创 UVa 755 487--3279
DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the Unive
2015-07-10 14:47:30
338
原创 UVa400 Unix ls
DescriptionThe computer company you work for is introducing a brand new computer line and is developing a new Unix-like operating system to be introduced along with the new computer. Your assignme
2015-07-10 13:18:36
565
原创 UVa120 Stacks of Flapjacks
DescriptionBackgroundStacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete event simulation. S
2015-07-08 12:51:12
330
原创 acdream 1146 Moist
Problem DescriptionMoist has a hobby -- collecting figure skating trading cards. His card collection has been growing, and it is now too large to keep in one disorganized pile. Moist needs to sort
2015-07-07 13:42:04
368
原创 UVa 10474 Where is the Marble?
Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another in ascending order of the number
2015-07-06 11:25:49
250
原创 UVA 10420 List of Conquests
In Act I, Leporello is telling Donna Elvira about his master's long list of conquests:``This is the list of the beauties my master has loved, a list I've made out myself: take a look, read it with m
2015-07-05 14:10:52
325
原创 UVA340 Master-Mind Hints
DescriptionMasterMind is a game for two players. One of them, Designer, selects a secret code. The other, Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning
2015-07-05 12:30:03
252
原创 HDU 1160 FatMouse's Speed
Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as pos
2015-06-16 10:37:54
311
原创 POJ 3069 Saruman's Army
DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the
2015-06-10 11:20:12
358
原创 Poj 3544 Journey with Pigs
/*Poj 3544 Journey with Pigs将n头猪卖给n个村庄,猪重wi,每个村庄到起点的距离是dj,每斤猪肉在第j个村庄的单价是pj,每斤猪肉运输一个单位长度花费t元,为保证赚到最多的钱,该怎样分配?输入n,t。接着输入,第一行为n个数表示猪的重量,第二行为n个数表示到村庄的距离,第三行为n个数表示每个村庄的猪肉价格。输出n个数,第j个数表示出售到第j个村庄的猪的编号,每只
2015-06-09 10:30:03
309
原创 HDU 1014 Uniform Generator
Problem DescriptionComputer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formseed(x+1) = [seed(x) + STEP] % MODwhere '%' is
2015-05-21 20:23:21
187
原创 UVa 550 Multiplying by Rotation
DescriptionWarning: Not all numbers in this problem are decimal numbers!Multiplication of natural numbers in general is a cumbersome operation. In some cases however the product can be o
2015-05-21 20:15:54
250
原创 poj 1565 Skew Binary
DescriptionWhen 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,
2015-05-21 20:13:04
301
原创 POj 1604 Just the Facts
DescriptionThe 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
2015-05-05 09:08:24
304
原创 HDU 1425 sort
Problem Description给你n个整数,请按从大到小的顺序输出其中前m大的数。 Input每组测试数据有两行,第一行有两个数n,m(0 Output对每组测试数据按从大到小的顺序输出前m大的数。 Sample Input5 33 -35 92 213 -644
2015-04-09 15:55:46
229
原创 HDU 1108 最小公倍数
Problem Description给定两个正整数,计算这两个数的最小公倍数。 Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数. Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。 Sample Input10 14 Sam
2015-04-04 16:51:31
264
原创 HDU2046 骨牌铺方格
Description在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0 Output对于每个测试实例,请输出铺放方案的总数
2015-04-03 20:31:26
283
原创 HDU 1061 Rightmost Digit
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N. InputThe input contains several test cases. The first line of the input is a single in
2015-04-02 15:36:17
263
原创 CodeForces 10A Power Consumption Calculation
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the k
2015-04-01 19:02:51
433
原创 CodeForces 7A Kalevitch and Chess
A famous Berland's painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more than a thousand years people have been playing this old game on uninteresting, monotonous
2015-04-01 18:53:04
340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人