## 623 - 500!

Moderator: Board moderators

### Re: 623 - 500!

for some strange reasons, my code is getting RE. i used the same code for 324 - Factorial Frequencies and got AC.for this prob, increased the limit of the strings as needed and i'm getting RE! can sm1 help me

Code: Select all
`removed after AC`
Do or do not. There is no try.
Scarecrow
Learning poster

Posts: 69
Joined: Wed Oct 19, 2011 9:06 pm

### Re: 623 - 500!

In this problem we must precalculate all possible factorials, and print them out when requested. Calculate factorials of 1 to 1000 takes so mush time. What is the good way to find them?

Code: Select all
`bignum f[1001];int main(){   int n;   f[0] = bignum("1");   f[1] = bignum("1");   for (int i = 2; i <= 1000; i++)      f[i] = f[i - 1] * bignum(i);   while (cin >> n)      cout << n << "!" << endl << f[n] << endl;}`

Thank you!
kia.masster
New poster

Posts: 6
Joined: Thu Dec 22, 2011 8:47 am

### Re: 623 - 500!

Yes precalculate them. It shouldn't take too long.
brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 623 - 500!

I am new in (Uva+Java). Please, help me. I am getting Rumtime error. why?
Code: Select all
`/* Removed */`
Last edited by uvasarker on Tue Nov 06, 2012 9:08 pm, edited 1 time in total.
uvasarker
Learning poster

Posts: 96
Joined: Tue Jul 19, 2011 12:19 pm

### Re: 623 - 500!

brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 623 - 500!

WOW! ACCCCC! thanks guru.
uvasarker
Learning poster

Posts: 96
Joined: Tue Jul 19, 2011 12:19 pm