結果

問題 No.1973 Divisor Sequence
ユーザー mkawa2mkawa2
提出日時 2023-03-18 18:47:56
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,321 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 80,240 KB
最終ジャッジ日時 2023-10-18 17:27:08
合計ジャッジ時間 7,283 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
58,172 KB
testcase_01 AC 36 ms
53,596 KB
testcase_02 AC 384 ms
75,764 KB
testcase_03 AC 59 ms
70,744 KB
testcase_04 AC 248 ms
75,764 KB
testcase_05 AC 78 ms
75,776 KB
testcase_06 AC 167 ms
75,760 KB
testcase_07 AC 76 ms
75,756 KB
testcase_08 AC 120 ms
75,760 KB
testcase_09 AC 224 ms
75,764 KB
testcase_10 AC 923 ms
75,804 KB
testcase_11 AC 82 ms
75,760 KB
testcase_12 AC 152 ms
75,756 KB
testcase_13 AC 96 ms
75,760 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
md = 10**9+7
# md = 998244353


# DPバージョン

def factors(a):
    if a<=0:return [0]
    dd0,dd1=[],[]
    for d in range(1,round(a**0.5)+1):
        if a%d:continue
        dd0.append(d)
        dd1.append(a//d)
    if dd0[-1]==dd1[-1]:dd1.pop()
    return dd0+dd1[::-1]

n,m=LI()

ff=factors(m)
fn=len(ff)
to=[[] for _ in range(fn)]

for i in range(fn):
    for j in range(fn):
        if m//ff[i]%ff[j]==0:
            to[i].append(j)

dp=[1]*fn
for _ in range(n-1):
    ndp=[0]*fn
    for i in range(fn):
        for j in to[i]:
            ndp[j]+=dp[i]
            ndp[j]%=md
    dp=ndp

ans=sum(dp)%md
print(ans)
0