Hongik Dance Party
Time limit1sMemory limit1024 MB
Given five lines of characters forming a 5-column-wide photograph, swap the two characters that mark the Ready to Leap and Leaping states, and print the resulting lines.
- Level
Easy2 of 10
- Topics
- Implementation, String, Simulation, Array
- Solved
- No attempts yet
Problem
Ten years ago, a dance party was held for the students of Hongik University.
As shown above, the dance party has three kinds of students.
The students stand in a single line, packed together with no empty space between them. On the next turn, a student who is Ready to Leap becomes Leaping, and a student who is Leaping becomes Ready to Leap. A student who is Seated does not change.
You captured the scene of the dance party in a single photograph.
Now, ten years later, having graduated and become a member of society, you found the photograph of the dance party while cleaning out your belongings. That single worn photograph was enough to immerse you in memories of the days when you were busy being worn down by everyday life.
To recall those days, infer the next turn's scene from the given photograph.
Input
The photograph of the dance party is given as lines of strings.
The maximum length of each line is characters, and all lines have the same length.
Each column is one of Ready to Leap, Leaping, and Seated.
Output
Print the next turn's scene of the dance party photograph given as input, as lines of strings.