#P7218. [JOISC 2020] 伝説の団子職人
[JOISC 2020] 伝説の団子職人
Background
You are a dango skewer master, and you are very strong.
Problem Description
In front of you is an grid. Each cell contains one dango. You may skewer three consecutive dango in order in a horizontal, vertical, or diagonal direction. “In order” means you may skewer them as top-middle-bottom, bottom-middle-top, etc., but you may not skewer them as middle-bottom-top, top-bottom-middle, etc.
If the colors of a skewered triple are green, white, pink or pink, white, green, then this triple is called an AK IOI skewer.
Find a way to skewer as many AK IOI skewers as possible (I firmly believe that making several AK IOI skewers will let you AK IOI several times).
Input Format
The first line contains two integers representing the grid size.
Then follow lines, each containing characters representing the grid:
Prepresents a pink dango.Wrepresents a white dango.Grepresents a green dango.
Output Format
Output lines, each containing characters representing the skewered grid:
- It may be
-,|,/,\, representing a skewer passing through a dango. - If it is not one of the above four symbols, output it as-is.
The output files should be 01.ans ~ 06.ans.
3 4
PWGP
WGPW
GWPG
P-GP
WGP|
G-PG
3 4
PWWP
WWWW
PGGP
PWWP
W\/W
PGGP
Hint
Sample 1 Explanation
You made AK IOI skewers.
Sample 2 Explanation
You made AK IOI skewers.
Constraints
This is an output-only problem.
This problem uses Special Judge.
There are testdata. It is guaranteed that . The input files can be obtained from the attachment. The detailed table is as follows:
| Test case | Score | Pass line | Good line | Excellent line |
|---|---|---|---|---|
Suppose is the number of AK IOI skewers you obtain. Then the scoring rule is (rounded to the nearest integer):
- If , then points.
- If , then points.
- If , then $\left(\dfrac{1}{2}+\dfrac{N-Y}{2(Z-Y)}\right) \times S$ points.
- If , then points.
If the output format is incorrect or the output is invalid, you will receive points.
Notes
Translated from The 19th Japanese Olympiad in Informatics Spring Training Camp Day 4 B The Legendary Dango Skewer Master.
Translated by ChatGPT 5