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

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.

Please upvote if you feel this is good idea! :slight_smile:

@admin : Let us know your opinion too.

35 Likes

Great suggestion … please do consider this @admin

2 Likes

Yes , it is a great idea. Test cases should be provided ,it will benefit us all.

3 Likes

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

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

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

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

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

@vsp4 : The admin has said that they will have to discuss more on this topic.

Suggestion - They can adopt the system of codeforces in which we can see the testcase which fails to pass.

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

“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.

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