結果
| 問題 |
No.502 階乗を計算するだけ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-08 00:19:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 167 bytes |
| コンパイル時間 | 496 ms |
| コンパイル使用メモリ | 82,252 KB |
| 実行使用メモリ | 66,024 KB |
| 最終ジャッジ日時 | 2024-07-16 03:32:34 |
| 合計ジャッジ時間 | 5,299 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 TLE * 1 -- * 19 |
ソースコード
n=int(input())
m = 10**9+7
res=1
while n > 1:
res=(res*(m-1 if (n//m)%2==1 else 1))%m
for i in range(2, n%m+1):
res= (res*i)%m
n //=m
print(res%m)