No.502 Just Compute the Factorial
問題文最終更新日: 2026-06-25 02:22:21
English (AI translation)
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
You are given an integer $n$. Find $X = n! \bmod (10^9+7)$.
Input
n
The input satisfies $0 \le n \le 10^{18}$.
Output
X
Print a newline at the end.
Sample
Sample 1
Input
5
Output
120
$5! = 120$.
Sample 2
Input
0
Output
1
Sample 3
Input
100
Output
437918130
$100! = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Pulmn