623 - 500!
UVa網站題目連結 My Solved Problems Performance In these days you can more and more often happen to see programs which perform some useful calculations being executed rather then trivial screen savers. Some of them check the system message queue and in case of finding it empty (for examples somebody is editing a file and stays idle for some time) execute its own algorithm. As an examples we can give programs which calculate primary numbers. One can also imagine a program which calculates a factorial of given numbers. In this case it is the time complexity of order O ( n ) which makes troubles, but the memory requirements. Considering the fact that 500! gives 1135-digit number no standard, neither integer nor floating, data type is applicable here. Your task is to write a programs which calculates a factorial of a given number. Assumptions: Value of a number `` n " which factorial should be calculated of does not exceed 1000 (although 500! is the name of the problem, 500! is a