Is there any option to check for exactly which testcase our programs is giving wrong answer.?

I am new to programming on CODECHEF. I am experiencing this problem in which my program runs perfectly for the given test cases in questions but says wrong answer while submitting. I want to know is there any way to find out for exactly which test case my program is failing?

20 Likes

No, you must deduce them yourself, or ask for help here if the question is in practice section (and not from some contest).

For arguments on why system is so, please give forums a search.

5 Likes

sometimes it shows wrong answer just because :

  1. you have taken int instead of long long int

  2. array size is small

  3. constraints are not satisfying

  4. You are applying some wrong approach although answer is matching for that

particular testcase.

  1. May be your program is correct for all testcase except one corner tricky case,In that case try to think and do more using pen and copy.It Helps a lot.
21 Likes

Hahaha… hahaha… welcome to the club bro, now you will come to know how does it feels when you code your heart out, but just because of some nasty and unknown corner case, you keep getting WA. :stuck_out_tongue:
P.S - but by not telling that corner case, codechef motivates user to think a lot, and that is a good thing…

38 Likes

bro u saved me!!!

1 Like

Thanks.

I may get downvotes but sometimes its really irritating when your code continues to give WA coz of some corner cases. That’s why i think codechef should provide testcases.

35 Likes

It will probably be useless either way. CodeForces provides testcases, yet in today’s Div2. I kept getting WA on test 3 on D, I saw the test afterwards and those were some giantic numbers. People in the comments provided some cases but my program printed them all correctly and I couldn’t do anything about it…

Even if you were to see a tc - chances are you won’t be able to reproduce issue unless you understand how your code works completely. Just practice coming up with testcases on your own, analyze the flow of your code and others’ code if needed. :slight_smile:

3 Likes

exactly bro

If you are really frustrated with this (not for use during contest because time consuming)
you can write a BRUTE FORCE SOLUTION with very simple idea and approach (might consume more time to run then optimal solution) and then DO STRESS TESTING for random test cases(via a program called GENERATOR) and match the answer came from BFS to your solution manually or via a program called CHECKER.
Just google about it you will get all procedures…

3 Likes

so much frustating

In that matter I think LeetCode is quite comfortable and user friendly as it clearly shows which test case has failed and also we only have to complete the given function remaining everything is handled by Leetcode on its own

3 Likes

I just realized seems so unfriendly!

try and try.

if that is so then why does it ask for subscription to show them, they shouldn’t be offering that either? Its just a way to gain profit… nothing else like motivation and stuff…