摘要: Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program to find and print the nth element in this sequenceInputThe input c 阅读全文
posted @ 2013-03-12 16:35 forevermemory 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目的地的路线,这时Ron(Harry最好的朋友)告诉Harry正好有一个魔法道具可以帮助他寻找这样的路线,而那个魔法道具上的咒语,正是由你纂写的. Input测试数据有多组,每组的表述如下:第一行有两个数,M和N,接下来是一个M行N列的地图,'*'表示障碍物,' 阅读全文
posted @ 2013-03-12 15:15 forevermemory 阅读(224) 评论(0) 推荐(0) 编辑