309707: CF1722B. Colourblindness

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

Description

Colourblindness

题意翻译

给定两个由 `RGB` 组成的字符串,`R`代表红色,`G` 代表绿色,`B` 代表蓝色。`Vasya` 有色盲症因此他无法分辨蓝色和绿色。问这两个字符串在 `Vasya` 眼里是否相同。 每个测试点包含多组询问。

题目描述

Vasya has a grid with $ 2 $ rows and $ n $ columns. He colours each cell red, green, or blue. Vasya is colourblind and can't distinguish green from blue. Determine if Vasya will consider the two rows of the grid to be coloured the same.

输入输出格式

输入格式


The input consists of multiple test cases. The first line contains an integer $ t $ ( $ 1 \leq t \leq 100 $ ) — the number of test cases. The description of the test cases follows. The first line of each test case contains an integer $ n $ ( $ 1 \leq n \leq 100 $ ) — the number of columns of the grid. The following two lines each contain a string consisting of $ n $ characters, each of which is either R, G, or B, representing a red, green, or blue cell, respectively — the description of the grid.

输出格式


For each test case, output "YES" if Vasya considers the grid's two rows to be identical, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

输入输出样例

输入样例 #1

6
2
RG
RB
4
GRBG
GBGB
5
GGGGG
BBBBB
7
BBBBBBB
RRRRRRR
8
RGBRRGBR
RGGRRBGR
1
G
G

输出样例 #1

YES
NO
YES
NO
YES
YES

说明

In the first test case, Vasya sees the second cell of each row as the same because the second cell of the first row is green and the second cell of the second row is blue, so he can't distinguish these two cells. The rest of the rows are equal in colour. Therefore, Vasya will say that the two rows are coloured the same, even though they aren't. In the second test case, Vasya can see that the two rows are different. In the third test case, every cell is green or blue, so Vasya will think they are the same.

Input

题意翻译

给定两个由 `RGB` 组成的字符串,`R`代表红色,`G` 代表绿色,`B` 代表蓝色。`Vasya` 有色盲症因此他无法分辨蓝色和绿色。问这两个字符串在 `Vasya` 眼里是否相同。 每个测试点包含多组询问。

Output

**色盲**

**题意翻译:**
给定两个由 `RGB` 组成的字符串,`R`代表红色,`G` 代表绿色,`B` 代表蓝色。`Vasya` 有色盲症因此他无法分辨蓝色和绿色。问这两个字符串在 `Vasya` 眼里是否相同。每个测试点包含多组询问。

**题目描述:**
Vasya 有一个 $2$ 行 $n$ 列的网格。他给每个单元格染成红色、绿色或蓝色。Vasya 是色盲,无法区分绿色和蓝色。判断 Vasya 是否会认为网格的两行颜色相同。

**输入输出格式:**
**输入格式:**
输入包含多个测试用例。第一行包含一个整数 $t$ ( $1 \leq t \leq 100$ ) — 测试用例的数量。接下来是测试用例的描述。

每个测试用例的第一行包含一个整数 $n$ ( $1 \leq n \leq 100$ ) — 网格的列数。接下来的两行各包含一个由 $n$ 个字符组成的字符串,每个字符是 `R`、`G` 或 `B`,分别代表红色、绿色或蓝色的单元格 — 网格的描述。

**输出格式:**
对于每个测试用例,如果 Vasya 认为网格的两行相同,输出 "YES",否则输出 "NO"。答案可以用任何大小写输出(例如,"yEs"、"yes"、"Yes" 和 "YES" 都会被认为是肯定的回答)。

**输入输出样例:**
**输入样例 #1:**
```
6
2
RG
RB
4
GRBG
GBGB
5
GGGGG
BBBBB
7
BBBBBBB
RRRRRRR
8
RGBRRGBR
RGGRRBGR
1
G
G
```
**输出样例 #1:**
```
YES
NO
YES
NO
YES
YES
```

**说明:**
在第一个测试用例中,Vasya 会认为两行的第二个单元格是相同的,因为第一行的第二个单元格是绿色,第二行的第二个单元格是蓝色,他无法区分这两个单元格。其余的行颜色相等。因此,Vasya 会说两行颜色相同,尽管它们实际上并不相同。

在第二个测试用例中,Vasya 可以看出两行是不同的。

在第三个测试用例中,每个单元格要么是绿色要么是蓝色,所以 Vasya 会认为它们是相同的。**色盲** **题意翻译:** 给定两个由 `RGB` 组成的字符串,`R`代表红色,`G` 代表绿色,`B` 代表蓝色。`Vasya` 有色盲症因此他无法分辨蓝色和绿色。问这两个字符串在 `Vasya` 眼里是否相同。每个测试点包含多组询问。 **题目描述:** Vasya 有一个 $2$ 行 $n$ 列的网格。他给每个单元格染成红色、绿色或蓝色。Vasya 是色盲,无法区分绿色和蓝色。判断 Vasya 是否会认为网格的两行颜色相同。 **输入输出格式:** **输入格式:** 输入包含多个测试用例。第一行包含一个整数 $t$ ( $1 \leq t \leq 100$ ) — 测试用例的数量。接下来是测试用例的描述。 每个测试用例的第一行包含一个整数 $n$ ( $1 \leq n \leq 100$ ) — 网格的列数。接下来的两行各包含一个由 $n$ 个字符组成的字符串,每个字符是 `R`、`G` 或 `B`,分别代表红色、绿色或蓝色的单元格 — 网格的描述。 **输出格式:** 对于每个测试用例,如果 Vasya 认为网格的两行相同,输出 "YES",否则输出 "NO"。答案可以用任何大小写输出(例如,"yEs"、"yes"、"Yes" 和 "YES" 都会被认为是肯定的回答)。 **输入输出样例:** **输入样例 #1:** ``` 6 2 RG RB 4 GRBG GBGB 5 GGGGG BBBBB 7 BBBBBBB RRRRRRR 8 RGBRRGBR RGGRRBGR 1 G G ``` **输出样例 #1:** ``` YES NO YES NO YES YES ``` **说明:** 在第一个测试用例中,Vasya 会认为两行的第二个单元格是相同的,因为第一行的第二个单元格是绿色,第二行的第二个单元格是蓝色,他无法区分这两个单元格。其余的行颜色相等。因此,Vasya 会说两行颜色相同,尽管它们实际上并不相同。 在第二个测试用例中,Vasya 可以看出两行是不同的。 在第三个测试用例中,每个单元格要么是绿色要么是蓝色,所以 Vasya 会认为它们是相同的。

加入题单

算法标签: