結果
| 問題 |
No.2326 Factorial to the Power of Factorial to the...
|
| コンテスト | |
| ユーザー |
koncha
|
| 提出日時 | 2023-05-28 14:52:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 273 bytes |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 81,956 KB |
| 実行使用メモリ | 59,304 KB |
| 最終ジャッジ日時 | 2024-12-27 03:17:51 |
| 合計ジャッジ時間 | 2,007 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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