結果

問題 No.2326 Factorial to the Power of Factorial to the...
ユーザー konchakoncha
提出日時 2023-05-28 14:40:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 1,341 ms
コンパイル使用メモリ 86,484 KB
実行使用メモリ 75,824 KB
最終ジャッジ日時 2023-08-27 10:18:22
合計ジャッジ時間 3,456 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,636 KB
testcase_01 WA -
testcase_02 AC 76 ms
75,824 KB
testcase_03 AC 78 ms
75,516 KB
testcase_04 WA -
testcase_05 AC 75 ms
75,636 KB
testcase_06 AC 76 ms
75,812 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 77 ms
75,432 KB
testcase_11 AC 76 ms
75,636 KB
testcase_12 AC 76 ms
75,436 KB
testcase_13 WA -
testcase_14 AC 76 ms
75,460 KB
testcase_15 WA -
testcase_16 AC 77 ms
75,812 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 78 ms
75,636 KB
testcase_20 AC 75 ms
71,180 KB
testcase_21 AC 76 ms
71,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
    now += 1

count *= total
print(count % MOD)
0