You are not logged in. Please login at www.codechef.com to post your questions!

×

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

39
6

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! :)

@admin : Let us know your opinion too.

asked 14 Sep '15, 17:37

kay_kay's gravatar image

4★kay_kay
1.2k721
accept rate: 20%

edited 14 Sep '15, 21:52

@admin Any update on this? :( :?

(12 Oct '15, 19:13) vsp46★

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

(21 Oct '15, 19:16) kay_kay4★
5

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

(22 Oct '15, 16:36) shubham992★

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.

link

answered 14 Sep '15, 21:06

abishek_kumar's gravatar image

1★abishek_kumar
862
accept rate: 100%

edited 14 Sep '15, 21:07

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.

link

answered 14 Sep '15, 22:24

vsp4's gravatar image

6★vsp4
1.2k138
accept rate: 28%

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 :P 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)
link

answered 13 Oct '15, 15:20

randomizer's gravatar image

4★randomizer
1462311
accept rate: 11%

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.

link

answered 02 Nov '16, 20:01

akshay29's gravatar image

2★akshay29
894
accept rate: 0%

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

link

answered 14 Sep '15, 20:54

shubham_sg's gravatar image

3★shubham_sg
413
accept rate: 0%

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.

link

answered 22 Oct '15, 22:39

theweblover007's gravatar image

2★theweblover007
10116
accept rate: 0%

Great suggestion ... please do consider this @admin...

link

answered 14 Sep '15, 20:46

sanstroke's gravatar image

4★sanstroke
2216
accept rate: 0%

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

link

answered 14 Sep '15, 23:15

vidhan13j07's gravatar image

4★vidhan13j07
313
accept rate: 0%

edited 14 Sep '15, 23:17

Good idea.

link

answered 15 Sep '15, 18:23

cartoonbadman's gravatar image

0★cartoonbadman
211
accept rate: 0%

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

link

answered 12 Oct '15, 21:18

rahul_mishra01's gravatar image

2★rahul_mishra01
8727
accept rate: 0%

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

link

answered 02 Nov '16, 21:44

diveshuttam's gravatar image

4★diveshuttam
53718
accept rate: 27%

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.

link

answered 14 Sep '15, 21:52

atulshanbhag's gravatar image

4★atulshanbhag
22629
accept rate: 9%

2

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.

(14 Sep '15, 22:06) kay_kay4★
1

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

(14 Sep '15, 22:12) atulshanbhag4★
1

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

(22 Oct '15, 19:19) rushilpaul4★

Not in favour, strongly disagree.

link

answered 12 Oct '15, 20:57

mayank_r_b's gravatar image

4★mayank_r_b
723
accept rate: 9%

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!

link

answered 22 Oct '15, 17:25

lordshiva1996's gravatar image

5★lordshiva1996
13615
accept rate: 20%

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.

link

answered 22 Oct '15, 20:16

drift_king's gravatar image

2★drift_king
413
accept rate: 0%

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.

link

answered 24 Nov '16, 15:22

mathecodician's gravatar image

6★mathecodician
2.6k11034
accept rate: 7%

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

link

answered 19 May '17, 00:36

theintel's gravatar image

3★theintel
4710
accept rate: 0%

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

link

answered 24 May '17, 13:37

vishnureddy7's gravatar image

2★vishnureddy7
1
accept rate: 0%

1

Not allowed. The contest is STILL on going.

(24 May '17, 13:48) vijju123 ♦♦5★

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.

link

answered 24 May '17, 14:43

ayush201's gravatar image

3★ayush201
61
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×15,852
×1,424
×365

question asked: 14 Sep '15, 17:37

question was seen: 4,911 times

last updated: 24 May '17, 14:43