
USACO
文章平均质量分 87
liveas
这个作者很懒,什么都没留下…
展开
-
【图论】【USACO】Bessie Come Home
<br /><br />It's dinner time, and the cows are out in their separate pastures. Farmer John rings the bell so they will start walking to the barn. Your job is to figure out which one cow gets to the barn first (the supplied test data will always have exactl原创 2010-08-04 07:53:00 · 1190 阅读 · 0 评论 -
【其他】【USACO】Ordered Fractions
<br />Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N. <br />Here is the set when N = 5: 0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1/1<br />Write a program that, given an integer N between 1 and原创 2010-06-10 15:33:00 · 1098 阅读 · 0 评论 -
【动态规划】【USACO】Subset Sums
<br />For many sets of consecutive integers from 1 through N (1 <= N <= 39), one can partition the set into two sets whose sums are identical. <br />For example, if N=3, one can partition the set {1, 2, 3} in one way so that the sums of both subsets are id原创 2010-06-10 21:27:00 · 2081 阅读 · 0 评论 -
【其他】【USACO】Runaround Numbers
Runaround numbers are integers with unique digits, none of which is zero (e.g., 81362) that also have an interesting property, exemplified by this demonstration: If you start at the left digit (8 in our number) and count that number of digits to the right原创 2010-06-11 07:33:00 · 992 阅读 · 0 评论 -
【模拟】【USACO】contact
<br /> <br />The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwave pulsing emission sent right from the centre of the galaxy. They wish to know if the emissi原创 2010-08-06 08:38:00 · 1355 阅读 · 0 评论 -
【其他】【USACO】Party Lamps
<br />To brighten up the gala dinner of the IOI'98 we have a set of N (10 <= N <= 100) colored lamps numbered from 1 to N. <br />The lamps are connected to four buttons: <br /> Button 1: When this button is pressed, all the lamps change their state: those原创 2010-06-11 17:45:00 · 815 阅读 · 0 评论 -
【动态规划】【USACO】Cow Pedigrees
<br /> <br />Farmer John is considering purchasing a new herd of cows. In this new herd, each mother cow gives birth to two children. The relationships among the cows can easily be represented by one or more binary trees with a total of N (3 <= N < 2原创 2010-06-14 11:03:00 · 1304 阅读 · 0 评论 -
【其他】【USACO】Zero Sum
<br />Consider the sequence of digits from 1 through N (where N=9) in increasing order: 1 2 3 ... N. <br />Now insert either a `+' for addition or a `-' for subtraction or a ` ' [blank] to run the digits together between each pair of digits (not in front o原创 2010-06-14 11:36:00 · 1062 阅读 · 0 评论 -
【动态规划】【USACO】Money Systems
<br />The cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Traditionally, coins come in values like 1, 5, 10, 20 or 25, 50, and 100原创 2010-06-14 15:08:00 · 1306 阅读 · 0 评论 -
【其他】【USACO】Controlling Companies
<br />Some companies are partial owners of other companies because they have acquired part of their total shares of stock. For example, Ford owns 12% of Mazda. It is said that a company A controls company B if at least one of the following conditions is sa原创 2010-06-14 17:56:00 · 661 阅读 · 0 评论 -
【其他】【USACO】The Tamworth Two
<br />A pair of cows is loose somewhere in the forest. Farmer John is lending his expertise to their capture. Your task is to model their behavior. <br />The chase takes place on a 10 by 10 planar grid. Squares can be empty or they can contain: an obstacle原创 2010-06-15 07:39:00 · 724 阅读 · 0 评论 -
【图论】【USACO】The Castle
<br />In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sweepstakes (really a lottery) for his birthday. This ticket turned out to have only the winning number for the lottery! Farmer John won a fabulous castle in th原创 2010-06-10 15:10:00 · 2053 阅读 · 1 评论 -
【搜索】【USACO】Healthy Holsteins
<br />Farmer John prides himself on having the healthiest dairy cows in the world. He knows the vitamin content for one scoop of each feed type and the minimum daily vitamin requirement for the cows. Help Farmer John feed his cows so they stay healthy whil原创 2010-06-10 17:15:00 · 1527 阅读 · 0 评论 -
【搜索】【USACO】Checker Challenge
Examine the 6x6 checkerboard below and note that the six checkers are arranged on the board so that one and only one is placed in each row and each column, and there is never more than one in any diagonal. (Diagonals run from southeast to northwest and sou原创 2010-06-10 07:31:00 · 519 阅读 · 0 评论 -
【图论】【USACO】Cow Tours
<br /><br />Farmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present time, you can find at least two pastures that cannot be connected by any sequence of cow paths,原创 2010-08-04 07:29:00 · 1278 阅读 · 1 评论 -
【图论】【USACO】Agri-Net
<br /><br /><br />Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.<br />Farmer John ordered a high speed connection for his farm and is原创 2010-08-05 06:59:00 · 2600 阅读 · 0 评论 -
【动态规划】【USACO】Score Inflation
<br /> <br />The more points students score in our contests, the happier we here at the USACO are. We try to design our contests so that people can score as many points as possible, and would like your assistance.<br />We have several categories from which原创 2010-08-05 07:13:00 · 1698 阅读 · 0 评论 -
【其他】【USACO】Humble Numbers
<br /> <br />For a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, for example, p1, p1p2, p1p1, and p1p2p3 (among others). This is the set of `humble numbers' for原创 2010-08-05 07:39:00 · 811 阅读 · 0 评论 -
【模拟】【USACO】Shaping Regions
N opaque rectangles (1 The coordinate system has its origin (0,0) at the sheet's lower left corner with axes parallel to the sheet's borders.PROGRAM NAME: rect1INPUT FORMATThe order of the i原创 2010-08-05 20:18:00 · 808 阅读 · 1 评论 -
【动态规划】【USACO】Stamps
<br /> <br />Given a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages from 1 cent to M cents that can be created.<br />For example, con原创 2010-08-06 14:17:00 · 1557 阅读 · 0 评论 -
【模拟】【USACO】Factorials
<br /> <br />The factorial of an integer N, written N!, is the product of all the integers from 1 through N inclusive. The factorial quickly becomes very large: 13! is too large to store in a 32-bit integer on most computers, and 70! is too large for most原创 2010-08-06 18:27:00 · 1450 阅读 · 0 评论 -
【动态规划】【USACO】Stringsobits
<br /> <br />Consider an ordered set S of strings of N (1 <= N <= 31) bits. Bits, of course, are either 0 or 1.<br />This set of strings is interesting because it is ordered and contains all possible strings of length N that have L (1 <= L <= N) or fewer b原创 2010-08-06 20:27:00 · 1951 阅读 · 1 评论 -
【模拟】【USACO】Spinning Wheels
<br /> <br />Each of five opaque spinning wheels has one or more wedges cut out of its edges. These wedges must be aligned quickly and correctly. Each wheel also has an alignment mark (at 0 degrees) so that the wheels can all be started in a known position原创 2010-08-06 21:48:00 · 1364 阅读 · 0 评论 -
【搜索】【USACO】Feed Ratios
<br /> <br />Farmer John feeds his cows only the finest mixture of cow food, which has three components: Barley, Oats, and Wheat. While he knows the precise mixture of these easily mixable grains, he can not buy that mixture! He buys three other mixtures o原创 2010-08-07 07:16:00 · 878 阅读 · 0 评论 -
【搜索】【USACO】Overfencing
<br />Farmer John went crazy and created a huge maze of fences out in a field. Happily, he left out two fence segments on the edges, and thus created two "exits" for the maze. Even more happily, the maze he created by this overfencing experience is a `perf原创 2010-06-15 11:24:00 · 978 阅读 · 0 评论