301519: CF287A. IQ Test
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
IQ Test
题意翻译
给定一张$4\times4$的纸,问是否可以在只改变至多一个格的情况下,使得纸上有$2\times2$的方格,且该方格内每一小格颜色一样。题目描述
In the city of Ultima Thule job applicants are often offered an IQ test. The test is as follows: the person gets a piece of squared paper with a $ 4×4 $ square painted on it. Some of the square's cells are painted black and others are painted white. Your task is to repaint at most one cell the other color so that the picture has a $ 2×2 $ square, completely consisting of cells of the same color. If the initial picture already has such a square, the person should just say so and the test will be completed. Your task is to write a program that determines whether it is possible to pass the test. You cannot pass the test if either repainting any cell or no action doesn't result in a $ 2×2 $ square, consisting of cells of the same color.输入输出格式
输入格式
Four lines contain four characters each: the $ j $ -th character of the $ i $ -th line equals "." if the cell in the $ i $ -th row and the $ j $ -th column of the square is painted white, and "\#", if the cell is black.
输出格式
Print "YES" (without the quotes), if the test can be passed and "NO" (without the quotes) otherwise.
输入输出样例
输入样例 #1
####
.#..
####
....
输出样例 #1
YES
输入样例 #2
####
....
####
....
输出样例 #2
NO