当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2679:Bloxorz

题目描述
Bloxorz is an interesting game and someone may have played it before. The rule of this game is simple.
This game is played on a platform constructed of many square grids. You have a cuboid whose size is 2×1×1. On the platform there is a 1×1 hole and it‘s your destination. What you have to do is move the cuboids to the hole. During the game you must keep the cuboid on the platform, if any part of cuboid is off the platform, you lose the game.
When this game starts, the cuboid stays on the platform. The way to move the cuboid is not sliding but rolling. You can move it in any of the four directions. If you want to move it right, the surfaces next to the original bottom in that direction will be the new bottom. In the following three images, the cuboid moves right twice.
Pic-1

    
输入解释
Input contains multiple test cases. Each test case starts with two integers N and M (0<N, M < 20), which stand for number of rows and columns of the platform. Then there comes N lines, describe the platform with ‘#’ for empty cell, ‘^’ for square grid, ‘X’ for the position of cuboid (There maybe two ‘X’, but data guarantee that these two ‘X’s belong to the same cuboid and only one cuboid exists.).
Then there comes several lines which stand for order list. Each line only contains uppercase characters and blank. In the list, ‘L’ means moving left, ‘R’ means moving right, ‘U’ means moving up and ‘D’ means moving down. If you meet a ‘Q’, print the whole station of platform. Each case ends with a line a line entitled “END”.
ANY MOVE COULD CAUSE YOU TO LOSE THE GAME, YOU SHOULD JUST IGNORE IT.
输出解释
Print a blank after each situation.
输入样例
5 6
^^^^^^
^X^^^^
^^^^^^
#^^^^^
###^^^
RQ
RQ
END
输出样例
^^^^^^
^^XX^^
^^^^^^
#^^^^^
###^^^

^^^^^^
^^^^X^
^^^^^^
#^^^^^
###^^^
来自杭电HDUOJ的附加信息
Author CTW
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2679

最后修改于 2020-10-25T22:55:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)