Test Cases for Contest Problems can be revealed after the contest!

This is really a great idea as we will be able to solve the problem in our own way instead of following approach given in the editorial.

7 Likes

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.

1 Like

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.

7 Likes

Yes the test case should be provided otherwise we don’t get to know where our program is failing.

2 Likes

Good idea.

2 Likes

Not in favour, strongly disagree.

2 Likes

I think its good to provide test cases after the contests get over, if you are cheating,then you are cheating to yourself only.

2 Likes

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 :stuck_out_tongue: for the script to throw up the relevant test case.

Here is the script i use mostly

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)
3 Likes

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!

1 Like

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.

1 Like

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.

2 Likes

I am requesting codechef to please provide test case of practice problem.
otherwise user will start moving to hackerearth,codeforce,hackerrank type of site where they provide test case of practice problem.
It is very important part of programming to know where are the mistakes.
when you know the mistakes then only you can grow/progress otherwise there is no point of solving question on codechef.

2 Likes

@admin i agree with this opinion at least the case at which our solution fails should be available.
And especially for practice problems. At times it become really difficult to learn as a beginner and instead of finding my own mistake i have to follow editorial’s approach or check someone’s solution.

1 Like

I agree with you. Codeforces has this system, Codechef can also have it. Admin said that they are changing their whole contest hosting procedure, they might add this feature.

The question title made me think that CodeChef actual did this.

can you give me more test cases for SAMESNAK problem in Snakdown 2017?

ya its very important sometimes i got WA in two test cases and when i ask my friend who codes the same logic in python he got AC so in such cases giving test cases is most important.

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.

2 Likes

Yeah, but the hackos system would be great. There should be a limit to the number of questions you can ask test cases for.

1 Like

@admin Any update on this? :frowning: :?