結果
問題 | No.2326 Factorial to the Power of Factorial to the... |
ユーザー |
|
提出日時 | 2023-05-28 15:40:07 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 294 bytes |
コンパイル時間 | 546 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 58,624 KB |
最終ジャッジ日時 | 2024-12-27 07:58:33 |
合計ジャッジ時間 | 2,546 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
n,p = map(int,input().split())mod = 10**9+7num = 0facts = 1fact2 = 1for i in range(1,n+1):now = iwhile now%p == 0:now //= pnum += 1facts *= ifacts %= modfact2 *= ifact2 %= mod-1po = pow(facts,fact2,mod)ans = num * po % modprint(ans)