USACO 1.3 Barn Repair
摘要:Barn RepairIt was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many of the cows were on vacation, so the barn was not completely full.The cows spend the night in stalls that are arranged adjacent to each other in a long line. Some s
阅读全文
posted @
2012-05-16 00:20
Zee、
阅读(194)
推荐(0)
USACO 1.3 milk
摘要:Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low as possible. Help Merry Milk Makers get the milk they need in the cheapest possible manner.The Merry Milk Makers company has several farmers from which they may buy milk,
阅读全文
posted @
2012-05-14 20:55
Zee、
阅读(176)
推荐(0)
USACO 1.2 Dual Palindromes
摘要:Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes have neither leading nor trailing zeroes, so
阅读全文
posted @
2012-05-10 21:33
Zee、
阅读(240)
推荐(0)
USACO 1.2 Palindromic Squares
摘要:Palindromic SquaresRob KolstadPalindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a number base B (2 <= B <= 20 base 10), print all the integers N (1 <= N <= 300 base 10) such that the square of N is palindromic when expressed
阅读全文
posted @
2012-05-10 18:07
Zee、
阅读(396)
推荐(0)
USACO 1.2 Transformations
摘要:TransformationsA square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformation
阅读全文
posted @
2012-05-09 12:07
Zee、
阅读(173)
推荐(0)
USACO 1.2 Milking Cows
摘要:Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 1000. The second farmer begins at time 700 and ends at time 1200. The third farmer begins at time 1500 a
阅读全文
posted @
2012-05-08 11:32
Zee、
阅读(266)
推荐(0)
USACO 1.1 Broken Necklace
摘要:Broken NecklaceYou have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random. Here are two examples for n=29: 1 2 1 2 r b b r b r r b r...
阅读全文
posted @
2012-05-08 09:49
Zee、
阅读(199)
推荐(0)