302398: CF462A. Appleman and Easy Task
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Appleman and Easy Task
题意翻译
有一个 $n \times n$ 棋盘,上面只有 `x` 或 `o` 两种字符。如果每个字符的周围四个字符中都有偶数个 `o`,输出 `YES`。否则输出 `NO`。题目描述
Toastman came up with a very easy task. He gives it to Appleman, but Appleman doesn't know how to solve it. Can you help him? Given a $ n×n $ checkerboard. Each cell of the board has either character 'x', or character 'o'. Is it true that each cell of the board has even number of adjacent cells with 'o'? Two cells of the board are adjacent if they share a side.输入输出格式
输入格式
The first line contains an integer $ n $ ( $ 1<=n<=100 $ ). Then $ n $ lines follow containing the description of the checkerboard. Each of them contains $ n $ characters (either 'x' or 'o') without spaces.
输出格式
Print "YES" or "NO" (without the quotes) depending on the answer to the problem.
输入输出样例
输入样例 #1
3
xxo
xox
oxx
输出样例 #1
YES
输入样例 #2
4
xxxo
xoxo
oxox
xxxx
输出样例 #2
NO