atcoder#ABC261B. [ABC261B] Tournament Result
[ABC261B] Tournament Result
Score : points
Problem Statement
players played a round-robin tournament.
You are given an -by- table containing the results of the matches. Let denote the element at the -th row and -th column of .
is -
if , and W
, L
, or D
otherwise.
is W
if Player beat Player , L
if Player lost to Player , and D
if Player drew with Player .
Determine whether the given table is contradictory.
The table is said to be contradictory when some of the following holds:
- There is a pair such that Player beat Player , but Player did not lose to Player ;
- There is a pair such that Player lost to Player , but Player did not beat Player ;
- There is a pair such that Player drew with Player , but Player did not draw with Player .
Constraints
- is
-
. - is
W
,L
, orD
, for .
Input
Input is given from Standard Input in the following format:
Output
If the given table is not contradictory, print correct
; if it is contradictory, print incorrect
.
4
-WWW
L-DD
LD-W
LDW-
incorrect
Player beat Player , while Player also beat Player , which is contradictory.
2
-D
D-
correct
There is no contradiction.