codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

462A.md (997B)


      1 Source: https://codeforces.com/problemset/problem/462/A
      2 
      3 A. Appleman and Easy Task
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 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?
     22 
     23 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.
     24 
     25 Input
     26 
     27 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.
     28 
     29 Output
     30 
     31 Print "YES" or "NO" (without the quotes) depending on the answer to the problem.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 3  
     39 xxo  
     40 xox  
     41 oxx
     42 ```
     43 
     44 Output
     45 
     46 ```
     47 YES
     48 ```
     49 
     50 Input
     51 
     52 ```
     53 4  
     54 xxxo  
     55 xoxo  
     56 oxox  
     57 xxxx
     58 ```
     59 
     60 Output
     61 
     62 ```
     63 NO
     64 ```