ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1195. Ouths and Crosses

What is wrong with this algorithm? How can I know Test 11?
Posted by Nodir NAZAROV Komiljonovich 27 Jan 2014 20:58
I've got WA#11. Here is my algorithm:

For each row, column and two diagonals count number of 'X' and 'O'.
 - If in any case number of 'X' is 2 and # of 'O' is zero, then crosses win (coz it's crosses turn).
 - If # of 'X' is 1 and # of 'O' is 0, then increase counter for X wins (if it's larger than 1 Crosses win).
 - If # of 'O' is 2 and # of 'X' is 0, then increase counter for O wins (if it's larger than 1 Ouths win).

Then I'll check if counter for X wins is larger than 1, print crosses win
 - else if counter for O wins is larger than 1, print Ouths win
 - else Draw