You are not logged in. Please login at www.codechef.com to post your questions!

×

[closed] 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.

asked 18 Jun '13, 14:09

kcahdog's gravatar image

3★kcahdog
10.0k2854129
accept rate: 14%

closed 29 Aug '13, 11:33

The question has been closed for the following reason "The question is answered, right answer was accepted" by kcahdog 29 Aug '13, 11:33


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 :).

link

answered 19 Jun '13, 20:26

sudokume's gravatar image

2★sudokume
411
accept rate: 50%

edited 19 Jun '13, 20:28

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

http://ideone.com/owhRcv

link

answered 19 Jun '13, 15:48

betlista's gravatar image

3★betlista ♦♦
16.9k49115225
accept rate: 11%

Yes, I'm also having the same problem :( 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.

link

answered 18 Jun '13, 22:46

sudokume's gravatar image

2★sudokume
411
accept rate: 50%

@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.

link

answered 19 Jun '13, 14:21

kcahdog's gravatar image

3★kcahdog
10.0k2854129
accept rate: 14%

@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!

link

answered 19 Jun '13, 21:33

kcahdog's gravatar image

3★kcahdog
10.0k2854129
accept rate: 14%

That's why there is always some example input ;-)

(20 Jun '13, 15:49) betlista ♦♦3★

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×37
×1

question asked: 18 Jun '13, 14:09

question was seen: 1,859 times

last updated: 29 Aug '13, 11:33