摘要: Font Size: ← →Problem Description Given a positive integer N, you should output the leftmost digit of N^N. Input The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.Each test case contains a single positive i 阅读全文
posted @ 2012-04-19 22:32 狸の舞 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Font Size: ← →Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。 如上图,机器人一开始在(1,1)点,并拥有4单位能量,蓝色方块表示他所能到达的点,如果他在这次路径选择中选择的终点是(2,4)点,当他到达(2,4)点时将拥有1单位的能量,并开始下一次路径选择. 阅读全文
posted @ 2012-04-19 21:50 狸の舞 阅读(305) 评论(1) 推荐(0) 编辑