結果
| 問題 |
No.2326 Factorial to the Power of Factorial to the...
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2023-05-30 00:02:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 48 ms / 2,000 ms |
| コード長 | 252 bytes |
| コンパイル時間 | 1,946 ms |
| コンパイル使用メモリ | 81,792 KB |
| 実行使用メモリ | 59,136 KB |
| 最終ジャッジ日時 | 2024-12-28 11:01:19 |
| 合計ジャッジ時間 | 2,329 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
n, p = map(int, input().split())
x1, x2, c = 1, 1, 0
MOD = 10**9 + 7
for i in range(n):
x1 *= i + 1
x1 %= MOD
x2 *= i + 1
x2 %= MOD - 1
y = i + 1
while y % p == 0:
c += 1
y //= p
print(c * pow(x1, x2, MOD) % MOD)
遭難者