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


Correct Answer on my home computer, but wrong in the codechef judge

I am new to this platform, and I am participating in July Challenge 2018 (my first competition here) I tried submitting a solution to the first problem, but the judge gives wrong answer (WA) as its verdict. I compile the same in my home computer and it works perfectly fine there. I know, I am not supposed to post the solutions to ongoing challenges here, but what where am I going wrong?

asked 06 Jul '18, 17:13

r_bajaj1997's gravatar image

accept rate: 0%

edited 06 Jul '18, 17:16


Full test data is not revealed. Your solution runs for critical inputs for which it is/might be giving wrong output. Also, superflous print statements give wrong answer, as its a machine checking for an exact match between whats asked and what you print.

(06 Jul '18, 22:49) vijju123 ♦♦5★

is it regarding the magic set question because the question is not explained well and the test case is explained for n=2 i asked in the comment section of the question to explain a test case with n=5 so that we can understand the question properly still no reply yet


answered 07 Jul '18, 05:14

eobardthawne's gravatar image

accept rate: 0%

They will probably reply in once in a day...

(07 Jul '18, 08:30) l_returns5★

General advice to new programmers at codechef :
print the answer in exact same format as asked in question... (Don't print please enter this and that)
Please check for corner cases and try testing your logic for different random inputs and think about missing corner case in your soln...
Can't help more as it is a live contest.. ping me after contest if u still have any query..


answered 06 Jul '18, 17:28

l_returns's gravatar image

accept rate: 25%

edited 06 Jul '18, 17:29

ahh solved it finally the test case should be explained in detail


answered 07 Jul '18, 07:06

eobardthawne's gravatar image

accept rate: 0%

Probably you have not made initialisation for some variables, and your compiler initialises them to zero but then Codechef judge doesn't.


answered 07 Jul '18, 10:39

reach_negative's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 06 Jul '18, 17:13

question was seen: 317 times

last updated: 07 Jul '18, 10:39