問題一覧 > 通常問題

No.500 Factorial Calculator

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 411
作問者 : nmnmnmnmnmnmnm / テスター : tatuyan_edson
お気に入りにしたユーザー ProblemId : 1097 / 自分の提出
問題文最終更新日: 2026-06-25 02:51:52
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 160 (順位表) の他の問題:

Problem Statement

The factorial calculator is a calculator that computes the factorial of any positive integer within 2 seconds.
When you enter a positive integer $N$ and press the "!" button, it computes the factorial $N!$ of $N$.
However, the calculator's LCD is broken, and it displays only up to the last 12 digits.
After you enter a positive integer $N$ and press the "!" button, what does the calculator display?

Input

$N$

$N$ is a positive integer. $1 \le N \le 999999999999$

Output

Output the answer on one line. Print a newline at the end.

Sample

Sample 1
Input
4
Output
24

4! is $4 \times 3 \times 2 \times 1=24$.

Sample 2
Input
12
Output
479001600

12!=479001600.

Sample 3
Input
24
Output
239439360000

Note that the answer is displayed only up to the last 12 digits at most.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。