摘要: Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 int n,c,m,i,j,cas; 9 struct node 10 { 11 int left,step; 12 string str... 阅读全文
posted @ 2013-11-14 15:10 persistent codeants 阅读(320) 评论(0) 推荐(0)
摘要: Problem Description推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱子推到指定的位置,注意,搬运工只能推箱子而不能拉箱子,因此如果箱子被推到一个角上(如图2)那么箱子就不能再被移动了,如果箱子被推到一面墙上,那么箱子只能沿着墙移动.现在给定房间的结构,箱子的位置,搬运工的位置和箱子要被推去的位置,请你计算出搬运工至少要推动箱子多少格.Input输入数据的第一行是一个整数T(1 2 #include 3 #include 4 #include 5 #include 6 7 using namesp... 阅读全文
posted @ 2013-11-14 13:23 persistent codeants 阅读(490) 评论(0) 推荐(0)