CodeChef has tagged my solution as wrong even tho the output matches document

Hey people, I’ve been trying hard to fix the issue with my code for MATCHES problem.

I’ve formatted inputs and outputs in a manner to match the example case given on problem documentation

and yet it doesn’t accept my solution. Does anyone know what test case might be failing this code?

Very true, it’s happening with me too since 4 contests!

1 Like

Did you find anyway to solve these ghost errors?

No, actually my input output matches exactly for the given test-cases but when I submit it doesn’t gets accepted because of which I’ve been losing a lot of rating lately

LOL SAME. I enrolled today on CodeChef to try it out on a friend’s recommendation and this was the first problem I decided to work upon and this happened :frowning:

There are some hidden test cases also, your code failed on some hidden test cases. The correct answer on sample test cases doesn’t ensure your code is completely right.

2 Likes

Your code failed on this test case
1
444 55
correct output: 16
your output: 43862
There might be some more test cases where your code fails.

2 Likes

These are the just the example / basic test cases, on which you are doing fine. But these are not the complete cases. There are hidden test cases / corner cases on which the logic you implemented fails. System won’t mark your answer as correct because it is, in fact, incorrect. There is a flaw in your logic. Try to think of cases where your code might not give correct answers.

@rash20000 Your code is fine. You just made one silly mistake. The size of array should be 10 and not 9.
Please see following link, I used your code (only change is size of array ) :

https://www.codechef.com/viewsolution/43189040

OH. i see my mistake.

why didn’t it give me an array overflow error?