CF926D.Choose Place
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
A classroom in a school has six rows with 3 desks in each row. Two people can use the same desk: one sitting on the left and one sitting on the right.
Some places are already occupied, and some places are vacant. Petya has just entered the class and wants to occupy the most convenient place. The conveniences of the places are shown on the picture:

Here, the desks in the top row are the closest to the blackboard, while the desks in the bottom row are the furthest from the blackboard.
You are given a plan of the class, where '*' denotes an occupied place, '.' denotes a vacant place, and the aisles are denoted by '-'.
Find any of the most convenient vacant places for Petya.
某学校的一间教室共有六行,每行三张课桌。每张课桌可坐两人:一人坐左侧,一人坐右侧。
部分座位已被占用,部分座位空闲。佩佳刚刚进入教室,希望选择最方便的空座位。各座位的便利程度如图所示:

其中,最上面一行的课桌离黑板最近,最下面一行的课桌离黑板最远。
现给出教室的座位布局图,其中 '*' 表示已被占用的座位,'.' 表示空闲座位,而过道用 '-' 表示。
请为佩佳找出任意一个最方便的空座位。
输入格式
The input consists of 6 lines. Each line describes one row of desks, starting from the closest to the blackboard. Each line is given in the following format: two characters, each is '*' or '.' — the description of the left desk in the current row; a character '-' — the aisle; two characters, each is '*' or '.' — the description of the center desk in the current row; a character '-' — the aisle; two characters, each is '*' or '.' — the description of the right desk in the current row. So, the length of each of the six lines is 8.
It is guaranteed that there is at least one vacant place in the classroom.
输入包含 6 行。每行描述教室中一行课桌,从离黑板最近的一行开始。每行的格式如下:两个字符(每个为 * 或 .),表示当前行左侧课桌的状态;一个字符 -,表示过道;两个字符(每个为 * 或 .),表示当前行中间课桌的状态;一个字符 -,表示过道;两个字符(每个为 * 或 .),表示当前行右侧课桌的状态。因此,这六行中每一行的长度均为 8。
保证教室内至少存在一个空位。
输出格式
Print the plan of the classroom after Petya takes one of the most convenient for him places. Mark this place with the letter 'P'. There should be exactly one letter 'P' in the plan. Petya can only take a vacant place. In all other places the output should coincide with the input.
If there are multiple answers, print any.
在佩佳选择一个对他最方便的座位后,输出教室的平面图,并用字母 'P' 标记该座位。平面图中应恰好包含一个字母 'P'。佩佳只能选择一个空座位。其余所有位置的输出应与输入完全一致。
若存在多个可行解,输出任意一个即可。
输入输出样例
输入#1
..-**-.. ..-**-.. ..-..-.. ..-..-.. ..-..-.. ..-..-..
输出#1
..-**-.. ..-**-.. ..-..-.. ..-P.-.. ..-..-.. ..-..-..
输入#2
**-**-** **-**-** ..-**-.* **-**-** ..-..-.. ..-**-..
输出#2
**-**-** **-**-** ..-**-.* **-**-** ..-P.-.. ..-**-..
输入#3
**-**-*. *.-*.-** **-**-** **-**-** ..-..-.. ..-**-..
输出#3
**-**-*. *.-*P-** **-**-** **-**-** ..-..-.. ..-**-..
说明/提示
In the first example the maximum convenience is 3.
In the second example the maximum convenience is 2.
In the third example the maximum convenience is 4.
在第一个例子中,最大便利性为 3。
在第二个例子中,最大便利性为 2。
在第三个例子中,最大便利性为 4。
输入解题思路,AI测评打分。不知道怎么写?