A15309 | Colourblindness
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
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).
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.
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.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted