結果

問題 No.2326 Factorial to the Power of Factorial to the...
ユーザー kemunikukemuniku
提出日時 2023-05-28 14:02:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 76,072 KB
最終ジャッジ日時 2023-08-27 08:51:56
合計ジャッジ時間 3,220 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,684 KB
testcase_01 WA -
testcase_02 AC 74 ms
75,924 KB
testcase_03 AC 75 ms
75,744 KB
testcase_04 WA -
testcase_05 AC 75 ms
75,848 KB
testcase_06 AC 76 ms
75,824 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 75 ms
75,836 KB
testcase_11 AC 75 ms
75,800 KB
testcase_12 AC 75 ms
75,768 KB
testcase_13 WA -
testcase_14 AC 77 ms
76,072 KB
testcase_15 WA -
testcase_16 AC 74 ms
75,736 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 76 ms
75,692 KB
testcase_20 AC 73 ms
71,108 KB
testcase_21 AC 72 ms
71,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def func(x,p):
    res = 0
    y = p
    while x//y != 0:
        res += x//y
        y*=p
    return res
MOD = 10**9+7
N,P = map(int,input().split())
tmp = 1
for i in range(2,N+1):
    tmp = (tmp*i)%MOD

print(func(N,P)*pow(tmp,tmp,MOD)%MOD)
0