CF1028A.Find Square
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Consider a table of size n×m, initially fully white. Rows are numbered 1 through n from top to bottom, columns 1 through m from left to right. Some square inside the table with odd side length was painted black. Find the center of this square.
考虑一个大小为 n×m 的表格,初始时全部为白色。行从上到下编号为 1 到 n,列从左到右编号为 1 到 m。表格内部某个边长为奇数的正方形区域被涂成黑色。请找出该正方形的中心。
输入格式
The first line contains two integers n and m (1≤n,m≤115) — the number of rows and the number of columns in the table.
The i-th of the next n lines contains a string of m characters si1si2…sim (sij is 'W' for white cells and 'B' for black cells), describing the i-th row of the table.
第一行包含两个整数 n 和 m(1≤n,m≤115),分别表示表格的行数和列数。
接下来的 n 行中,第 i 行包含一个长度为 m 的字符串 si1si2…sim(其中 sij 为 'W' 表示白色格子,为 'B' 表示黑色格子),描述表格的第 i 行。
输出格式
Output two integers r and c (1≤r≤n, 1≤c≤m) separated by a space — the row and column numbers of the center of the black square.
输出两个整数 r 和 c(1≤r≤n,1≤c≤m),以空格分隔——分别为黑色正方形中心所在的行号和列号。
输入输出样例
输入#1
5 6 WWBBBW WWBBBW WWBBBW WWWWWW WWWWWW
输出#1
2 4
输入#2
3 3 WWW BWW WWW
输出#2
2 1
输入解题思路,AI测评打分。不知道怎么写?