309833: CF1742C. Stripes

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:2 Solved:0

Description

Stripes

题意翻译

$8\times8$ 的染色地图,初始是白色,给你染完色的地图,`.` 代表白色,`R` 代表红色,`B` 代表蓝色。 其中染红色的策略必定是涂一行,染蓝色的策略必定是涂一列。颜色会覆盖。 求最后涂的颜色是什么,`R`代表红,`B` 代表蓝。

题目描述

On an $ 8 \times 8 $ grid, some horizontal rows have been painted red, and some vertical columns have been painted blue, in some order. The stripes are drawn sequentially, one after the other. When the stripe is drawn, it repaints all the cells through which it passes. Determine which color was used last. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1742C/6f423ce4b1dd07561098c185bf230d882c12b3e9.png)The red stripe was painted after the blue one, so the answer is R.

输入输出格式

输入格式


The first line of the input contains a single integer $ t $ ( $ 1 \leq t \leq 4000 $ ) — the number of test cases. The description of test cases follows. There is an empty line before each test case. Each test case consists of $ 8 $ lines, each containing $ 8 $ characters. Each of these characters is either 'R', 'B', or '.', denoting a red square, a blue square, and an unpainted square, respectively. It is guaranteed that the given field is obtained from a colorless one by drawing horizontal red rows and vertical blue columns. At least one stripe is painted.

输出格式


For each test case, output 'R' if a red stripe was painted last, and 'B' if a blue stripe was painted last (without quotes).

输入输出样例

输入样例 #1

4


....B...
....B...
....B...
RRRRRRRR
....B...
....B...
....B...
....B...


RRRRRRRB
B......B
B......B
B......B
B......B
B......B
B......B
RRRRRRRB


RRRRRRBB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB


........
........
........
RRRRRRRR
........
........
........
........

输出样例 #1

R
B
B
R

说明

The first test case is pictured in the statement. In the second test case, the first blue column is painted first, then the first and last red rows, and finally the last blue column. Since a blue stripe is painted last, the answer is B.

Input

题意翻译

$8\times8$ 的染色地图,初始是白色,给你染完色的地图,`.` 代表白色,`R` 代表红色,`B` 代表蓝色。 其中染红色的策略必定是涂一行,染蓝色的策略必定是涂一列。颜色会覆盖。 求最后涂的颜色是什么,`R`代表红,`B` 代表蓝。

Output

题目大意:
在8×8的格子地图上,某些行被涂成了红色,某些列被涂成了蓝色,涂色是按顺序进行的,每次涂色会覆盖经过的所有格子。需要确定最后使用的颜色是红色还是蓝色。

输入输出数据格式:
输入格式:
第一行包含一个整数t(1≤t≤4000),表示测试用例的数量。每个测试用例由8行组成,每行包含8个字符,每个字符是'R'、'B'或'.',分别表示红色方块、蓝色方块和未涂色方块。保证给定的地图是由一个无色的地图通过绘制水平红色行和垂直蓝色列得到的。至少会涂一条条纹。

输出格式:
对于每个测试用例,如果最后涂的是红色条纹,输出'R';如果最后涂的是蓝色条纹,输出'B'。

输入输出样例:
输入样例 #1:
```
4

....B...
....B...
....B...
RRRRRRRR
....B...
....B...
....B...
....B...


RRRRRRRB
B......B
B......B
B......B
B......B
B......B
B......B
RRRRRRRB


RRRRRRBB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB
RRRRRRBB
.B.B..BB
.B.B..BB


........
........
........
RRRRRRRR
........
........
........
........
```
输出样例 #1:
```
R
B
B
R
```题目大意: 在8×8的格子地图上,某些行被涂成了红色,某些列被涂成了蓝色,涂色是按顺序进行的,每次涂色会覆盖经过的所有格子。需要确定最后使用的颜色是红色还是蓝色。 输入输出数据格式: 输入格式: 第一行包含一个整数t(1≤t≤4000),表示测试用例的数量。每个测试用例由8行组成,每行包含8个字符,每个字符是'R'、'B'或'.',分别表示红色方块、蓝色方块和未涂色方块。保证给定的地图是由一个无色的地图通过绘制水平红色行和垂直蓝色列得到的。至少会涂一条条纹。 输出格式: 对于每个测试用例,如果最后涂的是红色条纹,输出'R';如果最后涂的是蓝色条纹,输出'B'。 输入输出样例: 输入样例 #1: ``` 4 ....B... ....B... ....B... RRRRRRRR ....B... ....B... ....B... ....B... RRRRRRRB B......B B......B B......B B......B B......B B......B RRRRRRRB RRRRRRBB .B.B..BB RRRRRRBB .B.B..BB .B.B..BB RRRRRRBB .B.B..BB .B.B..BB ........ ........ ........ RRRRRRRR ........ ........ ........ ........ ``` 输出样例 #1: ``` R B B R ```

加入题单

算法标签: