I solved my first Codechef problem and submitted it, but it shows judge error? I don’t understand what seems to be the problem?
Hey @aakash_rohila - can you share the problem link here. I ll try and help you debug this.
Hi, this is the problem statement:
I am still getting judge error while submission…
The number of test cases can be as big as 21000. So, the size of all the arrays you declared in your solution should be at least 21000. Here’s an Accepted solution.
Hey bro, saw your solution to the problem. Just a constructive criticism, that is NOT the right way of handling the testcases.
Whenever you have testcases to answer, make sure that you put the logic in a loop.
For eg, lets say I have “t” testcases to solve for any random problem, then i would write the logic for one testcase and then wrap that logic in a loop which runs t times:
// LOGIC TO SOLVE THE PROBLEM FOR A SINGLE TESTCASE
I hope that it helped, don’t worry! Since it is your first problem on codechef, you will probably get stuck. All the best on your journey of Competitive programming