2013年2月3日

USACO2.1.4--Healthy Holsteins

摘要: Healthy HolsteinsBurch & KolstadFarmer 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 while minimizing t 阅读全文

posted @ 2013-02-03 19:42 仗剑奔走天涯 阅读(201) 评论(0) 推荐(0) 编辑

2013年2月2日

USACO2.1.3--Sorting a Three-Valued Sequence

摘要: Sorting a Three-Valued SequenceIOI'96 - Day 2Sorting is one of the most frequently performed computational tasks. Consider the special sorting problem in which the records to be sorted have at mostthreedifferent key values. This happens for instance when we sort medalists of a competition accord 阅读全文

posted @ 2013-02-02 22:25 仗剑奔走天涯 阅读(177) 评论(0) 推荐(0) 编辑

USACO2.1.2--Ordered Fractions

摘要: Ordered FractionsConsider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N.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/1Write a program that, given an integer N between 1 and 160 inclusive, prints the fractions in order of 阅读全文

posted @ 2013-02-02 20:53 仗剑奔走天涯 阅读(201) 评论(0) 推荐(0) 编辑

USACO2.1.1--The Castle

摘要: The CastleIOI'94 - Day 1In 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 the Irish countryside.Br 阅读全文

posted @ 2013-02-02 18:40 仗剑奔走天涯 阅读(277) 评论(0) 推荐(0) 编辑

2013年1月31日

USACO1.5.4--Checker Challenge

摘要: Checker ChallengeExamine 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 southwest to northeast and inc 阅读全文

posted @ 2013-01-31 23:01 仗剑奔走天涯 阅读(215) 评论(0) 推荐(0) 编辑

USACO1.5.3--Superprime Rib

摘要: Superprime RibButchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across them, one by one, by FJ and the USDA. Farmer John ensures that a purchaser of his prime ribs gets really prime ribs because when sliced from the 阅读全文

posted @ 2013-01-31 11:02 仗剑奔走天涯 阅读(252) 评论(0) 推荐(0) 编辑

USACO1.5.2--Prime Palindromes

摘要: Prime PalindromesThe number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as backward). Write a program that finds all prime palindromes in the range of two supplied numbers a and b (5 <= a < b <= 100,000,000); both a a 阅读全文

posted @ 2013-01-31 10:25 仗剑奔走天涯 阅读(975) 评论(0) 推荐(0) 编辑

2013年1月30日

USACO1.5.1--Number Triangles

摘要: Number TrianglesConsider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right. 7 ... 阅读全文

posted @ 2013-01-30 22:58 仗剑奔走天涯 阅读(210) 评论(0) 推荐(0) 编辑

2013年1月29日

USACO1.4.4--Mother's Milk

摘要: Mother's MilkFarmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second 阅读全文

posted @ 2013-01-29 22:34 仗剑奔走天涯 阅读(182) 评论(0) 推荐(0) 编辑

2013年1月21日

USACO1.4.3--Arithmetic Progressions

摘要: Arithmetic ProgressionsAn arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+nb where n=0,1,2,3,... . For this problem, a is a non-negative integer and b is a positive integer.Write a program that finds all arithmetic progressions of length n in the set S of bisquares. The set of 阅读全文

posted @ 2013-01-21 16:12 仗剑奔走天涯 阅读(245) 评论(0) 推荐(0) 编辑

USACO1.4.2--The Clocks

摘要: The ClocksIOI'94 - Day 2Consider nine clocks arranged in a 3x3 array thusly:|-------| |-------| |-------| | | | | | | | |---O | |---O | | O | | | | | | | |-------| |-------| |-------| A ... 阅读全文

posted @ 2013-01-21 11:59 仗剑奔走天涯 阅读(598) 评论(0) 推荐(0) 编辑

2013年1月17日

USACO1.3.4--Prime Cryptarithm

摘要: Prime CryptarithmThe following cryptarithm is a multiplication problem that can be solved by substituting digits from a specified set of N digits into the positions marked with *. If the set of prime digits {2,3,5,7} is selected, the cryptarithm is called a PRIME CRYPTARITHM. * * * x * * ... 阅读全文

posted @ 2013-01-17 10:22 仗剑奔走天涯 阅读(168) 评论(0) 推荐(0) 编辑

2013年1月16日

USACO1.3.3--Calf Flac

摘要: Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.Ignore punctuation, whitespace, numbers, and case 阅读全文

posted @ 2013-01-16 21:53 仗剑奔走天涯 阅读(218) 评论(0) 推荐(0) 编辑

2013年1月15日

USACO1.3.2--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 @ 2013-01-15 14:34 仗剑奔走天涯 阅读(159) 评论(0) 推荐(0) 编辑

2013年1月14日

USACO1.3.1--Mixing 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 @ 2013-01-14 21:24 仗剑奔走天涯 阅读(214) 评论(0) 推荐(0) 编辑

导航