結果

問題 No.1973 Divisor Sequence
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-06-10 22:54:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 75,484 KB
最終ジャッジ日時 2023-10-21 06:21:53
合計ジャッジ時間 4,717 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
57,320 KB
testcase_01 AC 53 ms
57,316 KB
testcase_02 AC 142 ms
75,388 KB
testcase_03 AC 74 ms
75,480 KB
testcase_04 AC 108 ms
75,396 KB
testcase_05 AC 70 ms
75,332 KB
testcase_06 AC 109 ms
75,392 KB
testcase_07 AC 76 ms
75,388 KB
testcase_08 AC 88 ms
75,388 KB
testcase_09 AC 99 ms
75,392 KB
testcase_10 AC 119 ms
75,392 KB
testcase_11 AC 72 ms
75,480 KB
testcase_12 AC 110 ms
75,392 KB
testcase_13 AC 83 ms
75,388 KB
testcase_14 AC 107 ms
75,444 KB
testcase_15 AC 125 ms
75,396 KB
testcase_16 AC 123 ms
75,396 KB
testcase_17 AC 104 ms
75,392 KB
testcase_18 AC 73 ms
75,432 KB
testcase_19 AC 139 ms
75,404 KB
testcase_20 AC 77 ms
75,484 KB
testcase_21 AC 122 ms
75,392 KB
testcase_22 AC 115 ms
75,392 KB
testcase_23 AC 294 ms
75,296 KB
testcase_24 AC 281 ms
75,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def calc(x):
    dp = [1]*(x+1)
    for i in range(n):
        ndp = [0]*(x+1)
        for j in range(x+1):
            ndp[j] = dp[x-j]
        for j in range(x):
            ndp[j+1] += ndp[j]
            ndp[j+1] %= mod
        dp = ndp
    return dp[-1]

ans = 1
for i in range(2,10**6+5):
    if m%i:
        continue
    c = 0
    while m%i == 0:
        m //= i
        c += 1
    ans *= calc(c)
    ans %= mod
if m > 1:
    ans *= calc(1)
    ans %= mod
print(ans)
0