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

×

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

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

1★r_bajaj1997
11
accept rate: 0%

edited 06 Jul '18, 17:16

1

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

link

answered 07 Jul '18, 05:14

eobardthawne's gravatar image

3★eobardthawne
664
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..

link

answered 06 Jul '18, 17:28

l_returns's gravatar image

5★l_returns
1.4k19
accept rate: 25%

edited 06 Jul '18, 17:29

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

link

answered 07 Jul '18, 07:06

eobardthawne's gravatar image

3★eobardthawne
664
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.

link

answered 07 Jul '18, 10:39

reach_negative's gravatar image

2★reach_negative
1
accept rate: 0%

toggle preview
Preview

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:

×2,718
×2,352
×1,070
×847
×151
×67

question asked: 06 Jul '18, 17:13

question was seen: 317 times

last updated: 07 Jul '18, 10:39