結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,892 KB
testcase_01 WA -
testcase_02 AC 71 ms
75,892 KB
testcase_03 AC 71 ms
75,884 KB
testcase_04 WA -
testcase_05 AC 72 ms
75,804 KB
testcase_06 AC 73 ms
75,920 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 69 ms
75,680 KB
testcase_11 AC 72 ms
75,916 KB
testcase_12 AC 72 ms
75,892 KB
testcase_13 WA -
testcase_14 AC 71 ms
75,776 KB
testcase_15 WA -
testcase_16 AC 71 ms
75,700 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 72 ms
75,796 KB
testcase_20 AC 67 ms
71,524 KB
testcase_21 AC 67 ms
70,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

def power(a, b, m):
    p = a
    Answer = 1
    for i in range(100):
        if (b>>i)&1:
            Answer = (Answer*p) % m
        p = (p*p) % m
    return Answer

N,P =map(int,input().split())
cnt = 1
for i in range(1,N+1):
    cnt *= i
    cnt %= mod

num = 0
i = P
while i <= N:
    num += N//i
    i = i**2
    
print(num*power(cnt,cnt,mod)%mod)
0