結果
| 問題 | No.2326 Factorial to the Power of Factorial to the... |
| コンテスト | |
| ユーザー |
koncha
|
| 提出日時 | 2023-05-28 14:52:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 352 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 58,240 KB |
| 最終ジャッジ日時 | 2026-06-01 20:30:55 |
| 合計ジャッジ時間 | 2,043 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 WA * 9 |
ソースコード
N, P = map(int, input().split())
MOD = 10**9 + 7
count = 0
now = 1
total = 1
for i in range(1, N+1):
total *= i
total %= MOD
total = pow(total, total, MOD)
while P**now <= N:
count += N // (P**now)
count %= MOD
now += 1
print((count*total) % MOD)
koncha