Will CodeChef provide test cases

Below is my code for this problem

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class SignLanguage
{

	public static void main(String[] args) throws Exception
	{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		PrintWriter pw =  new PrintWriter(System.out);
		
		int totalNumbers = Integer.parseInt(br.readLine());
		int number;
		String s;
		int i;
		
		while(totalNumbers-- > 0)
		{
			number = Integer.parseInt(br.readLine());
			s = br.readLine();
			char[] c = s.toCharArray();
						
			for (i = 0; i < number; i++)
			{
				if(c[i] == 'Y' || c[i] == 'I')
					break;
				
				if(c[number - 1] == 'N')
					break;
			}
			
			if(c[i] == 'Y')
			{
				pw.println("NOT INDIAN");
				
			}

			else if(c[i] == 'I')
			{
				pw.println("INDIAN");
				
			}
			
			else
			{
				pw.println("NOT SURE"); 
			}			
			
		} 
		pw.flush(); 
	}
}

This code works perfectly for the sample inputs given on the problem page but while executing it on the code chef Total Score as 0.00%.

There is no way to find for which testcase my code is failing as when tried with the sample testcase on the problem page it works perfectly fine.

Please advise what to do in such scenario and how to find where my code is going wrong.

@vipin16 bro I think codechef people are doing good by hiding test cases. It forces us to think about spoiler cases. If you want to learn by analysing the failed test cases better to practice on hackerrank and donā€™t say good bye to codechef just feel the signature taste of codechef.

plz tell me whats wrong with my code : CodeChef: Practical coding for everyone
I made solution according to problem ,it works for testcase displayed,but still wrong

I agree with you, that learning is easier with test cases, unfortunately almost no contest page shows test cases, thre are 2 exceptions that I know TopCoder and CodeForces.

3 Likes

@bhampton: There is a frame of reference. We reveal all the solutions of all the problems after the contest and the problems are also moved into the practice section for the users to try at leisure. And you can see otherā€™s solutions too. Check this: http://www.codechef.com/submissions. Revealing test data is a spoiler and short cut to correcting your solution. Its the pursuit of finding the unknown that makes it exciting.

3 Likes

We can also have partial scoringĀ test data on CodeChef. The online judge has the capability. But that does not yet convince us to reveal test data. Ad mentioned before, even in the practice section, we believe that revealing test data is a spoiler.

2 Likes

Even if we dont get partial scoring, providing just the detail like what was the status for each test file would be great help. It gives a hint if we are going totally wrong or somewhat in right direction.

If revealing test data is a spoiler then certainly revealing hundreds of examples of correct code is a spoiler!

Itā€™s so frustrating to as few as one input example from the problem definition. What is one to do when oneā€™s code seems correct but a simple ā€œWrong Answerā€ message is returned?

Google Code Jam gives you more test data for the ā€œsmallā€ version of each problem. At least you get to try your code with some data.

This is really a dealbreaker for me. I like the CodeChef site and the amount of problems available, but itā€™s just too frustrating to get such small input sets. Iā€™m moving on.

2 Likes

yeaā€¦this system is followed in codeforces

Not revealing failing test cases during contests is justifiable, However illogical if iā€™m solving problems from problem banks . Spoiler? How? After repeated failing if iā€™m not able to figure out theres no learning its just time spent to waste. As for editorials,LOOK-i have a completely different algorithm of my own and i want to know here i went wrong if i do-THATā€™S LEARNING.ā€œwhere you went wrongā€-thats learning. Editorials are just a way to see the problem through somebody elseā€™s mind and follow their algorithm and techniques. I donā€™t see it any different from copying others solutions.

39 Likes

BUT ATLEAST AT THE END OF THE CONTEST ,YOU CAN PROVIDE PROVIDE THE PARTICULAR TEST CASE WHERE A PARTICULAR CODE FAILS.THIS WILL HELP A LOT OF PROGRAMMER TO IDENTIFY THEIR MISTAKES INSTEAD OF LEARNING IT FROM EDITORIALS.

11 Likes

Hackerrank also

1 Like

@admin we will highly appreciate it if you give us the test cases on which our code got WA for practice problem it will be a great help for all.thanks

2 Likes
There is no way to find for which testcase my code is failing as when tried with the sample testcase on the problem page it works perfectly fine.

Ummmā€¦make your own custom test cases? Cā€™mon, spoonfeeding to that extent is harmful.

1 Like

I tried nearly 10 to 15 different test cases and it is working fine for each of them.
If possible just let me know the input for which my program fails as I have tried everything from my end.
I only want to know about the input so I could modify my program accordingly.

Here-

Input
1
4
NNIN

Your Output
NOT SURE

Expected Output
INDIAN

It is an Indian as it both performs the ā€˜Iā€™ gesture- which no foreigner does as told by problem statement.

Thank You :slight_smile:

I wont be able to learn if I keep making the same mistake over and over again. I donā€™t want test cases during a competition. All I need is one or two failing test cases in the practice section so I can debug my code and see where it is going wrong and see what mistakes I made so that I can rectify it and not make the same mistakes in the future. Is this too much to ask for?

1 Like

Itā€™s not exciting, itā€™s frustrating. I have a solution to a problem that appears to be the same algorithm as another solution that got the right answer, yet I have the wrong answer. Iā€™ve generated several testcases, but havenā€™t been able to figure out what is wrong with my code. Without seeing the failing testcase, it leads me to suspect that the problem is with the testcase, not my code. Thereā€™s no way we can check to see if in fact the testcase is wrong as sometimes happens. On Codeforces, for example, someone occasionally spots an error with a testcase, and it gets corrected. Thereā€™s no way that can happen when you donā€™t reveal the testcases even after the contest.

People identified that the testcases were wrong in a recent lunchtime; see e.g.