結果

問題 No.2326 Factorial to the Power of Factorial to the...
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-05-28 15:28:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 76,308 KB
最終ジャッジ日時 2023-08-27 12:12:06
合計ジャッジ時間 2,970 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,084 KB
testcase_01 WA -
testcase_02 AC 79 ms
75,944 KB
testcase_03 AC 79 ms
76,028 KB
testcase_04 WA -
testcase_05 AC 77 ms
76,036 KB
testcase_06 AC 77 ms
75,796 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 77 ms
75,748 KB
testcase_11 AC 79 ms
75,956 KB
testcase_12 AC 78 ms
76,024 KB
testcase_13 WA -
testcase_14 AC 78 ms
75,956 KB
testcase_15 WA -
testcase_16 AC 76 ms
75,924 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 76 ms
75,792 KB
testcase_20 AC 73 ms
71,104 KB
testcase_21 AC 75 ms
71,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p = map(int,input().split())
mod = 10**9+7

num = 0
facts = 1
for i in range(1,n+1):
    now = i
    while now%p == 0:
        now //= p
        num += 1
    
    facts *= i
    facts %= mod
po = pow(facts,facts,mod)
ans = num * po % mod
print(ans)
0