Page 1 of 2

10220 wa confused

Posted: Tue Jun 17, 2003 1:51 am
by zsepi
i honestly don't know what could be wrong with my solution - i pregenerate the factorials (0! -> 1000! - not even stripping the zeros from the end), calculate the sums of the digits, the program runs in time (less than a second), but still it's wa.... there cannot be tricky cases, the standard input works fine, so do my handchecked examples... Is there a trick in the format of the input I missed? I mean, is the following description correct?
Input: one integer for each test case, input ends with EOF
Output: one integer per line
thanx in advance for ur help

Posted: Tue Jun 17, 2003 10:53 am
by hager
It sounds like you're doing it right, and if you've handled the special case
of 0! correctly, there isn't much I can think of. You could post the code or send it to me and I'll be happy to check it for you.

Best regards

Posted: Sat Jun 21, 2003 4:04 am
by Trinity
OK!

I`m not here to answer your question, but to make one...
Which king of variable did you use to keep the answer of the factorial.. I mean... its a pretty big number and I can`t make it work, well the biggest factorial I can answer is 25, rsrsrs...
Did you make a different way to work with that giant number??

Thanx Trinity

10220

Posted: Tue Jul 29, 2003 5:54 am
by Zhao Le
Can any one tell me the way how can speed up the #10220?

I got TLE. :(

Posted: Tue Jul 29, 2003 5:01 pm
by Joseph Kurniawan
You can use precalc method for this problem.
For your reference see problem 324 - 500!

Posted: Wed Aug 20, 2003 5:46 am
by Master
Obeviously this is a big integer problem and the precalculation is must for this problem.

Re: TLE 10220.

Posted: Fri Nov 19, 2004 5:21 pm
by jhonny_yang
Zhao Le wrote:Can any one tell me the way how can speed up the #10220?

I got TLE. :(
using array only 10000 , save the result into the array. that's linear time

10220 - I Love Big Numbers !

Posted: Tue Jan 10, 2006 12:33 am
by boshkash1986
My solution runs in reasonable ammount of time but i get wrong answer i tried every possible answer but i always got WA
can anyone help with test case that can determine whether my code runs correctly or not

(Note : i tried 0!)


thanks alot for your help

Posted: Fri Jan 13, 2006 7:20 pm
by boshkash1986
can not anyone help me

Please

Posted: Fri Jan 13, 2006 10:14 pm
by Mohammad Mahmudur Rahman
0 is most probably not in the judge input. However, here are some I/O for your testing.

Code: Select all

1
2
3
6
10
62
88
299
400
619
987
1000
Output->

Code: Select all

1
2
6
9
27
306
531
2448
3402
5841
10206
10539

Posted: Mon Jan 16, 2006 1:56 am
by boshkash1986
thanks alot for your help
I had a small bug and i fixed it and i got AC

thanks again for your help

Posted: Wed Mar 01, 2006 8:28 pm
by Raiyan Kamal
Thanks Mahmud vai ! Small mistakes make such a big mess.

Posted: Sun Dec 10, 2006 10:21 pm
by kana
i've tried the test cases and my code outputs 10215 for input - 987. :o

can anyone help me with the ouptout of 987!. plz

Posted: Mon Dec 11, 2006 10:29 am
by Jan
I think I havent understood your question right. The output for 987 is 10206, which was posted by Mohammad Mahmudur Rahman. But if you want to know the value of 987! then PM me.

Re: 10220 - I Love Big Numbers !

Posted: Sun Jan 22, 2012 1:42 pm
by Scarecrow
i cant figure it out why i'm getting RE..seems no error.i used almost the same code for 623 - Factorial Frequencies and got AC. but here incresed the string sizes as needed and getting RE! plz can any1 help me.. :(

Code: Select all

removed after AC