Regarding testcases

Are there any guidelines, that are followed while preparing the testcase for problems in contests? Like if one testcase will failed while other passed, does this meaning that it might not handling one particular scenario? And if solution is getting AC in subtask 1 while in few testcase of subtask 2, if getting WA. Does this means, approach is altogether wrong or it can mean that probably for larger inputs its failing?

1 Like

Test Cases are made to check your code. They are not revealed to users
So unlike codeforces, codechef runs your code on all test cases.

Some problems are divided into sub-tasks -
To get the points assigned for the sub-task you have to pass all test cases in that Sub-task.
Eg. If a question of 100 points is divided into 2 sub tasks with different constraints
Subtask 1 - 30 points(Some constraint)
Subtask 2- 70 points(Original Constraints)
Your code passes few test case of Subtask 1 and few of Subtask 2 but not the whole subtask - You will not get any points
But if you pass all testcases in subtask 1 and none in subtask 2 you wll still get 30 points
Even if you pass a subtask It will be marked as AC

Coming to your question on approach-
if you pass few testcases and not the others
In some cases it is just that your code isnt able to proccess large inputs but it can also be a logical error like - fallthrough

You should try to optimize your code

Please like :slightly_smiling_face: