CF1692C.Where's the Bishop?
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Mihai has an 8×8 chessboard whose rows are numbered from 1 to 8 from top to bottom and whose columns are numbered from 1 to 8 from left to right.
Mihai has placed exactly one bishop on the chessboard. The bishop is not placed on the edges of the board. (In other words, the row and column of the bishop are between 2 and 7, inclusive.)
The bishop attacks in all directions diagonally, and there is no limit to the distance which the bishop can attack. Note that the cell on which the bishop is placed is also considered attacked.
An example of a bishop on a chessboard. The squares it attacks are marked in red.
Mihai has marked all squares the bishop attacks, but forgot where the bishop was! Help Mihai find the position of the bishop.
米海有一个 8×8 的国际象棋棋盘,行号从上到下依次为 1 到 8,列号从左到右依次为 1 到 8。
米海在棋盘上恰好放置了一枚主教(象)。该主教未被放置在棋盘的边缘上(即主教所在的行号与列号均在 2 到 7 之间,含端点)。
主教可沿所有对角线方向攻击,且攻击距离无限制。注意:主教所在格子本身也被视为被攻击的格子。
主教在棋盘上的一个示例。它所攻击的格子以红色标出。
米海已将主教所能攻击的所有格子标记出来,却忘记了主教原本的位置!请帮助米海找出主教的位置。
输入格式
The first line of the input contains a single integer t (1≤t≤36) — 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 '#' or '.', denoting a square under attack and a square not under attack, respectively.
输入的第一行包含一个整数 t(1≤t≤36),表示测试用例的数量。随后是各测试用例的描述。每个测试用例之前均有一空行。
每个测试用例由 8 行组成,每行包含 8 个字符。这些字符均为 '#' 或 '.',分别表示被攻击的格子和未被攻击的格子。
输出格式
For each test case, output two integers r and c (2≤r,c≤7) — the row and column of the bishop.
The input is generated in such a way that there is always exactly one possible location of the bishop that is not on the edge of the board.
对于每个测试用例,输出两个整数 r 和 c(2≤r,c≤7)——即主教所在的行号和列号。
输入数据的生成方式保证:主教有且仅有一个可能的位置,且该位置不在棋盘边缘。
输入输出样例
输入#1
3 .....#.. #...#... .#.#.... ..#..... .#.#.... #...#... .....#.. ......#. #.#..... .#...... #.#..... ...#.... ....#... .....#.. ......#. .......# .#.....# ..#...#. ...#.#.. ....#... ...#.#.. ..#...#. .#.....# #.......
输出#1
4 3 2 2 4 5
说明/提示
The first test case is pictured in the statement. Since the bishop lies in the intersection row 4 and column 3, the correct output is 4 3.
第一个测试用例如题面图示所示。由于主教位于第 4 行与第 3 列的交点处,因此正确输出为 4 3。
输入解题思路,AI测评打分。不知道怎么写?