1.5.3 Superprime Rib(dfs)
摘要:Butchering 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
阅读全文
posted @
2016-01-26 15:45
Sunny糖果
阅读(239)
推荐(0)
1.5.2 Prime Palindromes
摘要:The 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...
阅读全文
posted @
2016-01-26 15:11
Sunny糖果
阅读(152)
推荐(0)
1.5.1 Number Triangles(dp)
摘要:Consider 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
阅读全文
posted @
2016-01-26 14:35
Sunny糖果
阅读(181)
推荐(0)
1.4.2 Mother's Milk(dfs)
摘要:Farmer 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. Init
阅读全文
posted @
2016-01-26 14:21
Sunny糖果
阅读(181)
推荐(0)
1.4.1 Arithmetic Progressions
摘要:An 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 ...
阅读全文
posted @
2016-01-26 13:55
Sunny糖果
阅读(241)
推荐(0)
1.3.6 Ski Course Design
摘要:Farmer John has N hills on his farm (1 2 #include 3 #include 4 #include 5 using namespace std; 6 int a[1010]; 7 int main() 8 { 9 int n;10 ...
阅读全文
posted @
2016-01-26 12:28
Sunny糖果
阅读(249)
推荐(0)
1.3.5 Wormholes
摘要:Farmer John's hobby of conducting high-energy physics experiments on weekends has backfired, causing N wormholes (2 B . Bessie will travel to B the...
阅读全文
posted @
2016-01-26 12:28
Sunny糖果
阅读(233)
推荐(0)
1.3.3 Prime Cryptarithm
摘要:The following cryptarithm is a multiplication problem that can be solved by substituting digits from a specified set of N digits into the positions ma...
阅读全文
posted @
2016-01-25 02:19
Sunny糖果
阅读(239)
推荐(0)
1.3.4 Combination Lock
摘要:Farmer John's cows keep escaping from his farm and causing mischief. To try and prevent them from leaving, he purchases a fancy combination lock to ke...
阅读全文
posted @
2016-01-25 02:19
Sunny糖果
阅读(256)
推荐(0)
1.3.2 Barn Repair
摘要:It 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,...
阅读全文
posted @
2016-01-25 02:17
Sunny糖果
阅读(205)
推荐(0)
1.3.1 Mixing Milk
摘要:The Merry Milk Makers company buys milk from farmers, packages it into attractive 1- and 2-Unit bottles, and then sells that milk to grocery stores so...
阅读全文
posted @
2016-01-25 02:16
Sunny糖果
阅读(318)
推荐(0)
1.2.5 Dual Palindromes
摘要: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 7...
阅读全文
posted @
2016-01-25 02:15
Sunny糖果
阅读(182)
推荐(0)
1.2.4 Palindromic Squares
摘要:Palindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a number base B (2 2 #include 3 #in...
阅读全文
posted @
2016-01-25 02:14
Sunny糖果
阅读(186)
推荐(0)
1.2.3 Name That Number
摘要:Among the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The cow hands don't ...
阅读全文
posted @
2016-01-24 23:05
Sunny糖果
阅读(176)
推荐(0)
1.2.2 Transformations
摘要:A square pattern of size N x N (1 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 { 8 freopen("transform.in","r",stdin)...
阅读全文
posted @
2016-01-24 21:38
Sunny糖果
阅读(125)
推荐(0)
1.2.1 Milking Cows
摘要:Three 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 sec...
阅读全文
posted @
2016-01-23 17:50
Sunny糖果
阅读(172)
推荐(0)
1.1.4 Broken Necklace
摘要:You have a necklace of N red, white, or blue beads (3 2 #include 3 #include 4 #include 5 #define maxn 1111 6 using namespace std; 7 int c; 8 char s...
阅读全文
posted @
2016-01-23 17:23
Sunny糖果
阅读(226)
推荐(0)
1.1.3 Friday the Thirteenth
摘要:Is Friday the 13th really an unusual event?That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answe...
阅读全文
posted @
2016-01-23 15:15
Sunny糖果
阅读(188)
推荐(0)
1.1.2 Greedy Gift Givers
摘要:A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to...
阅读全文
posted @
2016-01-23 15:11
Sunny糖果
阅读(273)
推荐(0)
1.1.1 Your Ride Is Here
摘要:Your Ride Is HereIt is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on Earth. ...
阅读全文
posted @
2016-01-23 15:09
Sunny糖果
阅读(222)
推荐(0)