結果

問題 No.1581 Multiple Sequence
ユーザー convexineqconvexineq
提出日時 2021-07-03 05:25:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 265 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 101,184 KB
最終ジャッジ日時 2023-09-12 11:05:32
合計ジャッジ時間 5,412 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,224 KB
testcase_01 AC 72 ms
71,420 KB
testcase_02 AC 213 ms
89,424 KB
testcase_03 AC 230 ms
89,728 KB
testcase_04 AC 101 ms
76,996 KB
testcase_05 AC 216 ms
89,800 KB
testcase_06 AC 136 ms
86,052 KB
testcase_07 AC 100 ms
77,172 KB
testcase_08 AC 119 ms
84,572 KB
testcase_09 AC 213 ms
89,416 KB
testcase_10 AC 155 ms
87,064 KB
testcase_11 AC 91 ms
76,616 KB
testcase_12 AC 123 ms
84,748 KB
testcase_13 AC 85 ms
76,712 KB
testcase_14 AC 234 ms
89,824 KB
testcase_15 AC 179 ms
87,952 KB
testcase_16 AC 93 ms
76,932 KB
testcase_17 AC 260 ms
100,836 KB
testcase_18 AC 91 ms
76,324 KB
testcase_19 AC 200 ms
88,920 KB
testcase_20 AC 207 ms
89,188 KB
testcase_21 AC 222 ms
89,692 KB
testcase_22 AC 146 ms
86,524 KB
testcase_23 AC 265 ms
101,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9+7
m = int(input())
yaku = [[] for _ in range(m+1)]
for i in range(1,m+1):
    for j in range(i,m+1,i):
        yaku[j].append(i)
dp = [0]*(m+1)
dp[0] = 1
for i in range(1,m+1):
    for j in yaku[i]:
        dp[i] += dp[(i-j)//j]
    dp[i] %= MOD
print(dp[m])
0