Problem with Tic Tac Toe Tomek- GCJ question

This is regarding the problem Tic Tac Toe Tomek asked in round 0 of Code Jam this year.
link:tic tac toe tomek. I had got correct for both small and large input at code jam but it is showing WA here at Code chef.

link:This is my solution- in python

1)I am not able to find a test case where the code has failed.Please help me check if there is some problem in the code
2)Also there could be possibility that i am not taking input correctly or there is some problem in the input file. i am taking input as 4 strings. there might also be a problem with the way i read blank line after each test case though it works fine on my system.

Please make appropriate suggestions. thanks in advance.

Yes, I’m also having the same problem :frowning: I have correctly solved both small and large in GCJ this year, yet its showing WA here. (Of course, I have changed it to “Game not completed”)

PS) I’ve coded it in Python too.

@sudokume I believe the problem is that we are taking the input as array of strings. There might be some extra stray characters somewhere in the input file where there should be a blank line but i dont know how to correct that. there is no error in the 4 strings representing the grid as i checked by using only the first 4 characters of the 4 lines. it showed WA even after i did this.

@admin please check as it is highly unlikely 2 codes that were accepted in GCJ are both wrong.

Your code is not working for input from problem statement, did you test your code?

1 Like

Ah, I got it, thanks betlista.

It seems they’ve messed up the wording of “Input” in the problem.
In the input file, there will be spaces in between, like X O O O instead of XOOO. So just parse that out, then you’re good to go :).

1 Like

@sudokume @betlista thanks for the help. They have mentioned ’ Each test case consists of 4 lines with 4 characters each, with each character being ‘X’, ‘O’, ‘.’ or ‘T’’!! So it is not clear from the input statement that there are spaces in between the letters. good to see AC after 2 days!

That’s why there is always some example input :wink:

//