Re: [gcj] Re: Tic tac toe problem in google code jam
Your program outputs correctly. And here ate the content. Case #1: Game has not completed Case #2: Draw Case #3: O won Case #4: X won Case #5: Draw Case #6: O won Case #7: X won Case #8: O won Case #9: Game has not completed Case #10: X won Judged response for input A-small: *Correct!* On Wed, Apr 17, 2013 at 1:48 PM, Baris Acar ba...@acar.org.uk wrote: Sweta, Do you get the same problem if you upload the result of a known working solution? If so, the problem may be with your computer, your browser, your connection, or the gcj site itself. However, if uploading someone else's output file works, but your output does not, the problem is probably with your actual file. Is this the case? If so have you tried comparing such good and bad files with a diff utility? If there's no difference reported, you may need to choose an option to diff as a binary or byte-for-byte to check for subtle differences. If you're not sure how to do this, try uploading both good and bad files to a public site like Dropbox, and someone from this list could help. Barış On 17 Apr 2013, at 17:31, Adriano Ueda adriano.u...@gmail.com wrote: hi sweta... can you upload your input file? On Wed, Apr 17, 2013 at 1:26 PM, sweta sharma sharma.sweta1...@gmail.comwrote: Case #1: Game has not completed Case #2: Draw Case #3: O won Case #4: X won Case #5: Draw Case #6: O won Case #7: X won Case #8: O won Case #9: Game has not completed Case #10: X won This is the content of my output file... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/0rPj51-oh7oJ. For more options, visit https://groups.google.com/groups/opt_out. -- *Adriano Ueda* +55 11 99790-7077 adriano.u...@gmail.com * * -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.com wrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.comwrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.comwrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.com wrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post
Re: [gcj] Re: Tic tac toe problem in google code jam
Can u please tell me what should the output file containis it the output cases generated by the program..and if it is so then my output file isnt accepted...what to do? On Wed, Apr 17, 2013 at 9:08 PM, Carlos Guia carlos.guia.v...@gmail.comwrote: You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.comwrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.com wrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit
Re: [gcj] Re: Tic tac toe problem in google code jam
I checked everything...the logic is correct and even the output generated is correctthe output format is correct even... On Wed, Apr 17, 2013 at 9:34 PM, Vishwas B Sharma vishwassharmahe...@gmail.com wrote: Firstly check if your program logic is correct. And it is producing the correct output. If you are sure of that then one main reason for output not to be accepted is the difference in output format. The outputs are checked by programs which search for specific patters like Casespace#number:spaceAnswer. So these parsers reject anything that is not in the correct format. On Wed, Apr 17, 2013 at 11:54 AM, sweta sharma sharma.sweta1...@gmail.com wrote: Can u please tell me what should the output file containis it the output cases generated by the program..and if it is so then my output file isnt accepted...what to do? On Wed, Apr 17, 2013 at 9:08 PM, Carlos Guia carlos.guia.v...@gmail.comwrote: You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.com wrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.comwrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.comwrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this
Re: [gcj] Re: Tic tac toe problem in google code jam
Can you upload your output file here ? On Wed, Apr 17, 2013 at 6:06 PM, sweta sharma sharma.sweta1...@gmail.comwrote: I checked everything...the logic is correct and even the output generated is correctthe output format is correct even... On Wed, Apr 17, 2013 at 9:34 PM, Vishwas B Sharma vishwassharmahe...@gmail.com wrote: Firstly check if your program logic is correct. And it is producing the correct output. If you are sure of that then one main reason for output not to be accepted is the difference in output format. The outputs are checked by programs which search for specific patters like Casespace#number:spaceAnswer. So these parsers reject anything that is not in the correct format. On Wed, Apr 17, 2013 at 11:54 AM, sweta sharma sharma.sweta1...@gmail.com wrote: Can u please tell me what should the output file containis it the output cases generated by the program..and if it is so then my output file isnt accepted...what to do? On Wed, Apr 17, 2013 at 9:08 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.com wrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.comwrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.comwrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send
Re: [gcj] Re: Tic tac toe problem in google code jam
Yes, the output should be a text file with the results you generated for the input you downloaded. Before you do anything, check you submitted what you were supposed to: - Go to https://code.google.com/codejam/contests.html (and sign in if you aren't), - on the left, click on View my submissions - download the input/output pair for the one(s) marked incorrect - compare your output with the someone else's code (or upload them here if you prefer) Carlos Guía On Wed, Apr 17, 2013 at 12:54 PM, sweta sharma sharma.sweta1...@gmail.comwrote: Can u please tell me what should the output file containis it the output cases generated by the program..and if it is so then my output file isnt accepted...what to do? On Wed, Apr 17, 2013 at 9:08 PM, Carlos Guia carlos.guia.v...@gmail.comwrote: You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.com wrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.comwrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails
Re: [gcj] Re: Tic tac toe problem in google code jam
When I submit this file, it says Correct . If it says Incorrect with you , you should email codejam to see what the problem is. On Wed, Apr 17, 2013 at 6:20 PM, sharma.sweta1...@gmail.com wrote: Sent from Windows Mail *From:* Ayman Mohamed *Sent:* Wednesday, 17 April 2013 21:39 *To:* google-code@googlegroups.com Can you upload your output file here ? On Wed, Apr 17, 2013 at 6:06 PM, sweta sharma sharma.sweta1...@gmail.comwrote: I checked everything...the logic is correct and even the output generated is correctthe output format is correct even... On Wed, Apr 17, 2013 at 9:34 PM, Vishwas B Sharma vishwassharmahe...@gmail.com wrote: Firstly check if your program logic is correct. And it is producing the correct output. If you are sure of that then one main reason for output not to be accepted is the difference in output format. The outputs are checked by programs which search for specific patters like Casespace#number:spaceAnswer. So these parsers reject anything that is not in the correct format. On Wed, Apr 17, 2013 at 11:54 AM, sweta sharma sharma.sweta1...@gmail.com wrote: Can u please tell me what should the output file containis it the output cases generated by the program..and if it is so then my output file isnt accepted...what to do? On Wed, Apr 17, 2013 at 9:08 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: You can try contacting the codejam team at code...@google.com to ask them, I know in the past a friend who in a similar situation and he did in fact upload the wrong file. Carlos Guía On Wed, Apr 17, 2013 at 8:48 AM, sweta sharma sharma.sweta1...@gmail.com wrote: As far as i rem i tried to upload the correct output file and that too multiple times ...It wasnt accepted but today it isIs this because of some technical fault? On Wed, Apr 17, 2013 at 1:47 AM, Bill Bruns bruns.b...@gmail.comwrote: Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.com wrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.com wrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.comwrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out . -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out . -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to
[gcj] Re: Tic tac toe problem in google code jam
Case #1: Game has not completed Case #2: Draw Case #3: O won Case #4: X won Case #5: Draw Case #6: O won Case #7: X won Case #8: O won Case #9: Game has not completed Case #10: X won This is the content of my output file... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/0rPj51-oh7oJ. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
hi sweta... can you upload your input file? On Wed, Apr 17, 2013 at 1:26 PM, sweta sharma sharma.sweta1...@gmail.comwrote: Case #1: Game has not completed Case #2: Draw Case #3: O won Case #4: X won Case #5: Draw Case #6: O won Case #7: X won Case #8: O won Case #9: Game has not completed Case #10: X won This is the content of my output file... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/0rPj51-oh7oJ. For more options, visit https://groups.google.com/groups/opt_out. -- *Adriano Ueda* +55 11 99790-7077 adriano.u...@gmail.com * * -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
Sweta, Do you get the same problem if you upload the result of a known working solution? If so, the problem may be with your computer, your browser, your connection, or the gcj site itself. However, if uploading someone else's output file works, but your output does not, the problem is probably with your actual file. Is this the case? If so have you tried comparing such good and bad files with a diff utility? If there's no difference reported, you may need to choose an option to diff as a binary or byte-for-byte to check for subtle differences. If you're not sure how to do this, try uploading both good and bad files to a public site like Dropbox, and someone from this list could help. Barış On 17 Apr 2013, at 17:31, Adriano Ueda adriano.u...@gmail.com wrote: hi sweta... can you upload your input file? On Wed, Apr 17, 2013 at 1:26 PM, sweta sharma sharma.sweta1...@gmail.com wrote: Case #1: Game has not completed Case #2: Draw Case #3: O won Case #4: X won Case #5: Draw Case #6: O won Case #7: X won Case #8: O won Case #9: Game has not completed Case #10: X won This is the content of my output file... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/0rPj51-oh7oJ. For more options, visit https://groups.google.com/groups/opt_out. -- Adriano Ueda +55 11 99790-7077 adriano.u...@gmail.com -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
Dunno what was wrong on that day ☹ Sent from Windows Mail From: Malay Keshav Sent: Tuesday, 16 April 2013 12:54 To: google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.comwrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.comwrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.comwrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [gcj] Re: Tic tac toe problem in google code jam
Hi Sweta, Have you tried uploading your output today? If it gives a response of Correct today then likely on that day it was the wrong output file being uploaded, since your program uses the same output file name for both the large and the small problem sets. There is nothing wrong with the logic - I tried the practice files today and the outputs from your program were accepted. Bill On Tue, Apr 16, 2013 at 12:52 PM, Carlos Guia carlos.guia.v...@gmail.comwrote: Source code is not checked during the live round either. Carlos Guía On Tue, Apr 16, 2013 at 3:49 PM, ankush agarwal ankushagarwa...@gmail.com wrote: In practice mode only outputs are checked not source code so still the error in source code may be there. On Tue, Apr 16, 2013 at 4:15 PM, Sajal Sarkar ssstarsarkar...@gmail.comwrote: There could be multiple reason of failure of your submission. hardcoding is something which needs to be avoided. Wrong file submission caused a lot of people's solution to be failed at some time(including me :( ) or at some point failure for some special input which might get missed because of little less intelligence of the code(due to hardcoding)! I might be wrong but these are my thoughts! -Sajal On Tue, Apr 16, 2013 at 4:03 PM, sharma.sweta1...@gmail.com wrote: Dunno what was wrong on that day ☹ Sent from Windows Mail *From:* Malay Keshav *Sent:* Tuesday, 16 April 2013 12:54 *To:* google-code@googlegroups.com I just tried uploading your output for both the large and small dataset .. Both of them gave a correct response by the judge ... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- regards Ankush Agarwal..:) -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[gcj] Re: Tic tac toe problem in google code jam
Sweta, The only thing I've noticed that could cause problem is extra new line print in the end. However your program is very hard to read. Aurimas On Sunday, April 14, 2013 7:14:14 AM UTC+3, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #include #include #include struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;i { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;i { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) { fprintf(f,Case #%d: Draw\n,i+1); } else if ((full==0)(ch=='N')) { fprintf(f,Case #%d: Game has not completed\n,i+1); } } fprintf(f,\n); fclose(fp); fclose(f); return 0; } -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/784MGueP6hgJ. For more options, visit https://groups.google.com/groups/opt_out.
[gcj] Re: Tic tac toe problem in google code jam
On Sunday, 14 April 2013 09:44:14 UTC+5:30, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #includestdio.h #includectype.h #includestdlib.h struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;in;i++) { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;in;i++) { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) { fprintf(f,Case #%d: Draw\n,i+1); } else if ((full==0)(ch=='N')) { fprintf(f,Case #%d: Game has not completed\n,i+1); } } fprintf(f,\n); fclose(fp); fclose(f); return 0; } @arunimas .. even without the new line the program wasnt accepted and @tussarsingh13 : I tried hard to debug it but there doesnt seem any problem with the code... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/bGARuRtvxscJ. For more options, visit
Re: [gcj] Re: Tic tac toe problem in google code jam
A simple way to troubleshoot is to download a correct solution and execute it against the same input, then compare their output with yours using a diff utility. All participants' code is downloadable from the codejam site so pick someone who got the right answer for this problem. However, I recommend the go-hero site, which lets you easily filter solutions by language: http://www.go-hero.net/jam/13/solutions Barış On 16 Apr 2013, at 01:50, sweta sharma sharma.sweta1...@gmail.com wrote: On Sunday, 14 April 2013 09:44:14 UTC+5:30, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #includestdio.h #includectype.h #includestdlib.h struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;in;i++) { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;in;i++) { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) { fprintf(f,Case #%d: Draw\n,i+1); } else if ((full==0)(ch=='N')) { fprintf(f,Case #%d: Game has not completed\n,i+1); } } fprintf(f,\n); fclose(fp); fclose(f); return 0; } @arunimas .. even without the new line the program wasnt accepted and @tussarsingh13 : I tried hard to debug it but there doesnt seem any problem with the code... -- You received this message because you are subscribed to
Re: [gcj] Re: Tic tac toe problem in google code jam
Your code should be working fine.Your output matches with one generated by my code for both the large and small dataset.. Are you sure the judges response is incorrect ? On Tue, Apr 16, 2013 at 6:35 AM, Baris Acar ba...@acar.org.uk wrote: A simple way to troubleshoot is to download a correct solution and execute it against the same input, then compare their output with yours using a diff utility. All participants' code is downloadable from the codejam site so pick someone who got the right answer for this problem. However, I recommend the go-hero site, which lets you easily filter solutions by language: http://www.go-hero.net/jam/13/solutions Barış On 16 Apr 2013, at 01:50, sweta sharma sharma.sweta1...@gmail.com wrote: On Sunday, 14 April 2013 09:44:14 UTC+5:30, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #includestdio.h #includectype.h #includestdlib.h struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;in;i++) { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;in;i++) { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) { fprintf(f,Case #%d: Draw\n,i+1); } else if ((full==0)(ch=='N')) { fprintf(f,Case #%d: Game has not
Re: [gcj] Re: Tic tac toe problem in google code jam
hard coding the values maybe the problem. On 15 April 2013 21:43, Malay Keshav malay.kes...@gmail.com wrote: Your code should be working fine.Your output matches with one generated by my code for both the large and small dataset.. Are you sure the judges response is incorrect ? On Tue, Apr 16, 2013 at 6:35 AM, Baris Acar ba...@acar.org.uk wrote: A simple way to troubleshoot is to download a correct solution and execute it against the same input, then compare their output with yours using a diff utility. All participants' code is downloadable from the codejam site so pick someone who got the right answer for this problem. However, I recommend the go-hero site, which lets you easily filter solutions by language: http://www.go-hero.net/jam/13/solutions Barış On 16 Apr 2013, at 01:50, sweta sharma sharma.sweta1...@gmail.com wrote: On Sunday, 14 April 2013 09:44:14 UTC+5:30, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #includestdio.h #includectype.h #includestdlib.h struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;in;i++) { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;in;i++) { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) {
[gcj] Re: Tic tac toe problem in google code jam
On Sunday, 14 April 2013 09:44:14 UTC+5:30, sweta sharma wrote: I wrote the following program . The program is giving correct output for theinput file but the program isnt accepted...Its showing that its Incorrect...Can someone please tell me what the problem is ? Source code : #includestdio.h #includectype.h #includestdlib.h struct p { char board[4][4]; }*arr; char check_horizontal(int i,int j,int *full) { if(((arr[i].board[j][0]=='X')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='X')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='X')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='X')||(arr[i].board[j][3]=='T'))) { return 'X'; } if(((arr[i].board[j][0]=='O')||(arr[i].board[j][0]=='T'))((arr[i].board[j][1]=='O')||(arr[i].board[j][1]=='T'))((arr[i].board[j][2]=='O')||(arr[i].board[j][2]=='T'))((arr[i].board[j][3]=='O')||(arr[i].board[j][3]=='T'))) return 'O'; if((arr[i].board[j][0]=='.')||(arr[i].board[j][1]=='.')||(arr[i].board[j][2]=='.')||(arr[i].board[j][3]=='.')) *full=0; return 'N'; } char check_vertical(int i,int j) { if(((arr[i].board[0][j]=='X')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='X')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='X')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='X')||(arr[i].board[3][j]=='T'))) return 'X'; if(((arr[i].board[0][j]=='O')||(arr[i].board[0][j]=='T'))((arr[i].board[1][j]=='O')||(arr[i].board[1][j]=='T'))((arr[i].board[2][j]=='O')||(arr[i].board[2][j]=='T'))((arr[i].board[3][j]=='O')||(arr[i].board[3][j]=='T'))) { return 'O'; } return 'N'; } char check_diagonal(int i,int j) { if(j==0) { if(((arr[i].board[0][0]=='X')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='X')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='X')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='X')||(arr[i].board[3][3]=='T'))) return 'X'; if(((arr[i].board[0][0]=='O')||(arr[i].board[0][0]=='T'))((arr[i].board[1][1]=='O')||(arr[i].board[1][1]=='T'))((arr[i].board[2][2]=='O')||(arr[i].board[2][2]=='T'))((arr[i].board[3][3]=='O')||(arr[i].board[3][3]=='T'))) return 'O'; } if(j==3) { if(((arr[i].board[0][3]=='X')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='X')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='X')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='X')||(arr[i].board[3][0]=='T'))) return 'X'; if(((arr[i].board[0][3]=='O')||(arr[i].board[0][3]=='T'))((arr[i].board[1][2]=='O')||(arr[i].board[1][2]=='T'))((arr[i].board[2][1]=='O')||(arr[i].board[2][1]=='T'))((arr[i].board[3][0]=='O')||(arr[i].board[3][0]=='T'))) return 'O'; } return 'N'; } int main() { FILE *fp,*f; fp=fopen(A-small-attempt0.in,r); f=fopen(out.txt,w); int n,i,j,k,draw,full=1; char ch; fscanf(fp,%d\n,n); arr=(struct p *)malloc(n*sizeof(struct p)); for(i=0;in;i++) { for(j=0;j4;j++) { arr[i].board[j][0]=fgetc(fp); arr[i].board[j][1]=fgetc(fp); arr[i].board[j][2]=fgetc(fp); arr[i].board[j][3]=fgetc(fp); ch=fgetc(fp); } ch=fgetc(fp); } for(i=0;in;i++) { draw=1;full=1; for(j=0;j4;j++) { ch=check_horizontal(i,j,full); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if(ch=='N') ch=check_vertical(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } if((j==0)||(j==3)) { ch=check_diagonal(i,j); if(ch=='X') { fprintf(f,Case #%d: X won\n,i+1); break; } else if(ch=='O') { fprintf(f,Case #%d: O won\n,i+1); break; } } } if((ch=='N')(full==1)) { fprintf(f,Case #%d: Draw\n,i+1); } else if ((full==0)(ch=='N')) { fprintf(f,Case #%d: Game has not completed\n,i+1); } } fprintf(f,\n); fclose(fp); fclose(f); return 0; } yes malay .. judges response was incorrectand I tried to match my output against the output generated by a downloaded source code available on gcj website... -- You received this message because you are subscribed to the Google Groups Google Code Jam group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/google-code/-/MMHamz1OfG8J. For more options, visit