2013年1月8日

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

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

USACO1.1.3--Friday the Thirteenth

摘要: Friday the ThirteenthIs 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 answer this question, write a program that will compute the frequency that the 13th of each month lands on Sunday, Monday, Tuesday, We 阅读全文

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

导航