understanding the test case concept

Hey everyone-
I’m stuck on the small factorial problem, but what I think I’m actually stuck on is properly coding the test cases portion of the challenges. By that I mean: I don’t understand how to make the test case/raw input not print to standard output and instead a part of the code to follow that. Do I need to pipe it? Does it need to be it’s own function(in the case of using python)?

Hey again dculver1986,

Actually, test cases work exactly as described on the FAQ section, and the “piping” as in redirecting the I/O to the official test case files is automatically handled by the judge, so, in case of python, to read use standard functions like:

x = int(raw_input())

and to print, again, standard functions like print:

print x

Best regards,

Bruno

Thanks for clearing that up for me, Bruno.
I keep getting a runtime error on it so I assumed I was not understanding the test case idea correctly. I have my raw input under a while loop using the factorial python utility, but it’s still not working…

Hmmm, try to post your code here please :slight_smile:

Your code is really weird. What is the meaning of

if t <= 100:

?

It seems that you really don’t understand the test case concept.

I don’t know python at all but just following intuitive logic
I’ve fixed your code by the smallest number of changes to get AC:
http://www.codechef.com/viewsolution/1568888

A better and shorter solutions is:
http://www.codechef.com/viewsolution/1568889

I watch the for, range stuff in some random python solution for this problem
here.

This page is quite new at codechef and it is really useful. You can setup filters to get any information that you need about submissions of any kind. As an example you can seek for AC solution on the language of your choice (say Python) for any problem.

1 Like

Thanks. I was trying to not look for the AC and figure it out because I’m still quite a n00b.

here was my code bruno http://www.codechef.com/viewsolution/1568859