摘要: 1.4.2的题目虽然有点眉目但是编码时却始终无从下手,找了份只有36行的结题报告却看不懂,运行了下还可以,结果就干了件丑事贴人家代码了,保证下不为例。题目: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 eit 阅读全文
posted @ 2012-07-17 16:52 萧若离 阅读(183) 评论(0) 推荐(0)
摘要: 题目: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 sec 阅读全文
posted @ 2012-07-14 15:25 萧若离 阅读(217) 评论(0) 推荐(0)
摘要: 题目:Packing RectanglesIOI 95The six basic layouts of four rectanglesFour rectangles are given. Find the smallest enclosing (new) rectangle into which these four may be fitted without overlapping. By smallest rectangle, we mean the one with the smallest area.All four rectangles should have their sides 阅读全文
posted @ 2012-07-11 15:52 萧若离 阅读(426) 评论(0) 推荐(0)
摘要: 题目: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 阅读全文
posted @ 2012-07-08 10:37 萧若离 阅读(291) 评论(0) 推荐(0)
摘要: 这是1.3的最后一题了。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. * * * ... 阅读全文
posted @ 2012-07-07 20:06 萧若离 阅读(225) 评论(0) 推荐(0)
摘要: 题目: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 c 阅读全文
posted @ 2012-07-07 16:39 萧若离 阅读(227) 评论(0) 推荐(0)
摘要: 题意: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. Som 阅读全文
posted @ 2012-06-08 16:49 萧若离 阅读(157) 评论(0) 推荐(0)
摘要: 题目: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 mi 阅读全文
posted @ 2012-06-08 12:55 萧若离 阅读(150) 评论(0) 推荐(0)
摘要: 题目: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, 阅读全文
posted @ 2012-06-03 20:20 萧若离 阅读(147) 评论(0) 推荐(0)
摘要: 题目: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 express 阅读全文
posted @ 2012-06-02 15:44 萧若离 阅读(143) 评论(0) 推荐(0)