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

建议使用的浏览器:

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

3702:Chessman

题目描述

There's an n × 1 chessboard filled with some chessman, where n is infinity. For each chessman, you can make any move of the following:

1.Jump to the 4th grid on the right or left, if that grid is empty. For example:
...*........
=>
.......*....

...****.....
=>
....****....

....*.**....
=>
...**.*.....

2. Jump to the 3rd grid on the right, if that grid is empty, as well as the second and the first grid on the right has and has not a chessman respectively. Then, after this the junp is taken, the first grid the chessman jumped over will have a chessman, and the second grid the chessman jumped over will be empty. For example:

...*.*.....
=>
....*.*....

3.Jump to the 2nd grid on the right, if that grid is empty and the grid the chessman is about to jump over has a chessman. Then, the grid the chessman jumped over will be empty. For example:

...**.....
=>
.....*....

Given the first 30 girds on the left (has or has not chessman) of two chessboards, the rest grids being all empty, decide whether the first chessboard can be changed to the second chessboard with those three kinds of moves listed above?

输入解释

The first line of the input is the number of test cases. For each case there are two lines. Each line contains 30 characters. '.' represents empty grid. '*' represents a chessman. There is a blank line before each test case.

输出解释

For each test case output the answer on a line: "YES" or "NO".  

输入样例
6

........................*.....
.........................*....

......*.......*...............
.........................*....

******************************
................**............

*...*..**.....................
...........................***

*******.****.**************.**
..**...*..*..*...**.*...**.*..

*******.****.**************.**
..**...**.*..*...**.*...**.*..
输出样例
NO
NO
YES
NO
YES
NO


该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3702

最后修改于 2020-10-29T07:08:32+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536