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) 编辑

导航