编程介的小学生 2017-04-01 11:29 采纳率: 20.5%
浏览 844
已采纳

Bomber

As we know, c.x. loved playing games. Especially she likes a game called "Bomber".

The game is in a maze of size N * N (N <= 50). There are walls, bricks and blanks in the maze. And you can walk on the road. You have many bombs (You may assume that we can provide you any number of bombs). And you can put a bomb on an empty gird. There will be at most one bomb in the maze at one time. You can explode the bomb. The bomb explosion wave will extend infinitely along four directions: up, right, down, left, until it meets a stone wall and stop there, or it meets a brick wall and stop there but also destroy the brick wall to a blank. When you are damaged by your own bomb, you are lost.

At first, you are at gird (1, 1). You should find a way that the bomber can move to the destination (N, N).

Input

First line of each testcase, there is one integer N.

Then N lines followed. Each line contains N characters. "#" for walls, "X" for bricks, and "." for blanks.

Proceed to the end of file.

Output

You should output how the bomber can move to the destination.

There are 4 operations:
1+ a letter [U, D, L, R]: Move to that direction.
2: Put a bomb on the current gird.
3: Explode the bomb.
4: This testcase is end.

We guarantee that there is at least one solution. You may output any of them. And if your output is too long, you may get an "OLE".

Sample Input

3
..X
X.X
XXX

Sample Output

1R
1D
2
1U
1L
3
1D
1R
1R
2
1L
1U
3
1D
1D
1R
4

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-10 15:50
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘