UVa 623

From Algorithmist
Jump to navigation Jump to search

623 - 500![edit]

Summary[edit]

A BigNum problem. Precalculate all possible factorials, and print them out when requested.

Explanation[edit]

A BigNum problem. Precalculate all possible factorials, and print them out when requested.

Gotchas[edit]

Although the problem is called 500!, the actual input limit is N = 1000. And Remember that 0! = 1.

Input[edit]

10
30
50
100

Output[edit]

10!
3628800
30!
265252859812191058636308480000000
50!
30414093201713378043612608166064768844377641568960512000000000000
100!
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

Solutions[edit]