编程介的小学生 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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号