Glitching screen
InterviewTime limit1sMemory limit1024 MB
Given n candidate h by w pixel renderings and a current screen that may have dead pixels stuck off, decide whether exactly one stop matches.
- Level
Medium5 of 10
- Topics
- String, Implementation, Brute force, Matrix
- Solved
- No attempts yet
Problem
Petter is taking the local train in a new city for the first time. He is well prepared and has memorized the names of all the stops. However, some of the pixels on the monitor that displays the upcoming stop are broken. Can you help him decide what the next stop is?
Input
The first line of input consists of three integers , and , the height and width of the screen in pixels and the number of train stops, respectively. Then there are lines, where line to shows how train stop is rendered on a fully functioning screen (for stops ). The input ends with more lines that shows the current screen. Pixels on the screen that are turned on are denoted by x and pixels that are turned off are denoted by a period (.). If a screen is broken, it means that one or more of the pixels are always off.
Output
Output yes if you can tell him what the next stop is, and no otherwise.