There are many people whose solution fails for few test cases and hence get partially correct answers in the contest.
For Ex: Many people have got 85 points in LIGHTHSE and 60 points in REBXOR in the September Long Contest which means they have all failed to pass the 1st Subtask which might have contained some special/boundary cases.
To help people know their mistakes Codechef can post the Test Cases along with the editorial as people will be able to identify the mistakes in their own code which will be of great help.
Giving testcases has its downfalls. People intending to practice later on could cheat. Rather gve testcases to only those who pass certain testcases. And also use the ‘hackos’ system that hackerrank uses.
Some people cheat even now by submitting other’s solution as they can see everyone’s solution in practice. So, nothing can be done with them.
Giving test cases will help people who really want to solve problems on their own.
Yep. Should be done once the contest is over and problems are moved to practice section.
This was one of the reason why i practice more on codeforces then codechef. Its better to know where your code is failing rather then giving up and following editorial solution atlast.
When i face such problems like only one subtask showing WA after going through common mistakes like not using long int, parsing to wrong data type, dealing with garbage values etc etc…
I always write a brute-force solution and use a python script to generate random test cases and execute both the solutions simultaneously and wait and pray for the script to throw up the relevant test case.
import random
import os
#program to generate random test cases
#and find the failed test case of the solution using brute force solution
#generate random test cases
def generate():
strs=""
N=1
strs+=str(N)+"\n"
for i in range(0,N):
strs+=str(random.randint(1,100))+"\n"
return strs
for i in range(0,100):
strs=generate()
p=open("inps12.txt","w")
p.write(strs)
p.close()
proc=os.popen('bruteSolution.exe<inps12.txt')
Act_output=proc.read()
proc.close()
proc2=os.popen('optimizedSol.exe<inps12.txt')
My_output=proc2.read()
proc2.close()
if(Act_output!=My_output):
print(strs)
Yes, this is a great idea… We can even know how large the inputs can be, how our solution is tested , how the author sets boundary cases, and hence we can understand the problem completely!
“People intending to practice later on could cheat”
Cheat whom? They would only cheat themselves and will not learn. That won’t be a problem for anybody else, so I don’t see why giving out test cases has downfalls.
Good idea! ,test cases should be given so that without wasting much time on same problem we can quickly learn from our mistakes and proceed to next question because sometimes it happens that even after giving lot of time we are not able to figure out one silly mistake.
So thumbs up for this idea.
I dont think its a good idea at all. New programmers tend not to put their brains in the problem when presented with solution or tricky test cases. This has alot of disadvantages, and if they do that, they will never be able to change a WA into AC in a live contest. This happens in topcoder practice rooms all the time.
Again, If you are stuck, you must see solutions of other coders and compare them to your own, check for overflows. Thats how you learn.