結果

問題 No.1973 Divisor Sequence
ユーザー rlangevinrlangevin
提出日時 2022-08-25 22:50:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 622 bytes
コンパイル時間 991 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 82,176 KB
最終ジャッジ日時 2024-04-21 05:15:45
合計ジャッジ時間 4,264 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
59,392 KB
testcase_01 AC 42 ms
53,760 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def div(n):
    S = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            S.add(i)
            S.add(n // i)
        i += 1
    return sorted(list(S))

N, M = map(int, input().split())
mod = 10 ** 9 + 7
L = div(M)

pre = defaultdict(int)
pre[1] = 1
    
for i in range(N):
    dp = defaultdict(int)
    for k in L:
        c = pre[k] % mod
        for nk in L:
            if k * nk > M:
                break
            if (M // k) % nk == 0:
                dp[nk] += c 
    pre, dp = dp, pre

ans = 0
for k, v in pre.items():
    ans += v % mod
print(ans % mod)
0