UVa 10363

From Algorithmist
Jump to navigation Jump to search

10363 - Tic Tac Toe[edit]

Summary[edit]

Determine whether a tic tac toe game is valid or not.

Explanation[edit]

There are only a few rules here:

1.number of O's must be less than the number of X's.
2.If there is 1 more X than O then there can be an tic tac toe.
3.If there is equal number of X's and O's can have a tic tac toe.

Input[edit]

2
X.O
OO.
XXX

O.X
XX.
OOO

Output[edit]

yes
no