Score : $200$ points
$N$ players played a round-robin tournament.
You are given an $N$-by-$N$ table $A$ containing the results of the matches. Let $A_{i,j}$ denote the element at the $i$-th row and $j$-th column of $A$.
$A_{i,j}$ is -
if $i=j$, and W
, L
, or D
otherwise.
$A_{i,j}$ is W
if Player $i$ beat Player $j$, L
if Player $i$ lost to Player $j$, and D
if Player $i$ drew with Player $j$.
Determine whether the given table is contradictory.
The table is said to be contradictory when some of the following holds:
-
.W
, L
, or D
, for $i\neq j$.Input is given from Standard Input in the following format:
$N$ $A_{1,1}A_{1,2}\ldots A_{1,N}$ $A_{2,1}A_{2,2}\ldots A_{2,N}$ $\vdots$ $A_{N,1}A_{N,2}\ldots A_{N,N}$
If the given table is not contradictory, print correct
; if it is contradictory, print incorrect
.
4 -WWW L-DD LD-W LDW-
incorrect
Player $3$ beat Player $4$, while Player $4$ also beat Player $3$, which is contradictory.
2 -D D-
correct
There is no contradiction.