CF181A.Series of Crimes
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The Berland capital is shaken with three bold crimes committed by the Pihsters, a notorious criminal gang.
The Berland capital's map is represented by an n × m rectangular table. Each cell of the table on the map represents some districts of the capital.
The capital's main detective Polycarpus took a map and marked there the districts where the first three robberies had been committed as asterisks. Deduction tells Polycarpus that the fourth robbery will be committed in such district, that all four robbed districts will form the vertices of some rectangle, parallel to the sides of the map.
Polycarpus is good at deduction but he's hopeless at math. So he asked you to find the district where the fourth robbery will be committed.
贝尔兰首都接连发生了三起大胆的犯罪事件,作案者是臭名昭著的犯罪团伙“皮斯特帮”。
贝尔兰首都的地图由一个 n×m 的矩形表格表示。表格中的每个单元格代表首都的某个区域。
首都首席侦探波利卡普斯拿到了一张地图,并在上面用星号(*)标出了前三起抢劫案发生的区域。根据推理,波利卡普斯断定:第四起抢劫案将发生在这样一个区域,使得四起抢劫案发生的四个区域恰好构成一个矩形的四个顶点,且该矩形的边与地图的边界平行。
波利卡普斯擅长推理,但数学却一塌糊涂。因此,他请你帮忙找出第四起抢劫案将发生的区域。
输入格式
The first line contains two space-separated integers n and m (2 ≤ n, m ≤ 100) — the number of rows and columns in the table, correspondingly.
Each of the next n lines contains m characters — the description of the capital's map. Each character can either be a "." (dot), or an "*" (asterisk). A character equals "*" if the corresponding district has been robbed. Otherwise, it equals ".".
It is guaranteed that the map has exactly three characters "*" and we can always find the fourth district that meets the problem requirements.
第一行包含两个以空格分隔的整数 n 和 m(2≤n,m≤100),分别表示表格的行数和列数。
接下来的 n 行,每行包含 m 个字符,描述首都的地图。每个字符要么是 .(英文句点),要么是 *(星号)。若某字符为 *,则表示对应区域已被抢劫;否则该字符为 .。
保证地图中恰好有三个字符 *,且总能找到满足题目要求的第四个区域。
输出格式
Print two integers — the number of the row and the number of the column of the city district that is the fourth one to be robbed. The rows are numbered starting from one from top to bottom and the columns are numbered starting from one from left to right.
输出两个整数——被抢劫的第四个城区所在的行号和列号。行号从上到下依次编号,起始值为 1;列号从左到右依次编号,起始值为 1。
输入输出样例
输入#1
3 2 .* .. **
输出#1
1 1
输入#2
3 3 *.* *.. ...
输出#2
2 3
输入解题思路,AI测评打分。不知道怎么写?