結果

問題 No.1581 Multiple Sequence
ユーザー ayaoniayaoni
提出日時 2021-07-02 21:54:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 757 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 101,208 KB
最終ジャッジ日時 2023-09-11 21:46:50
合計ジャッジ時間 5,445 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,484 KB
testcase_01 AC 74 ms
71,336 KB
testcase_02 AC 212 ms
89,324 KB
testcase_03 AC 251 ms
89,640 KB
testcase_04 AC 104 ms
77,160 KB
testcase_05 AC 254 ms
90,056 KB
testcase_06 AC 138 ms
85,680 KB
testcase_07 AC 104 ms
77,348 KB
testcase_08 AC 124 ms
84,324 KB
testcase_09 AC 218 ms
89,560 KB
testcase_10 AC 159 ms
86,896 KB
testcase_11 AC 94 ms
76,560 KB
testcase_12 AC 124 ms
84,952 KB
testcase_13 AC 85 ms
76,556 KB
testcase_14 AC 234 ms
89,876 KB
testcase_15 AC 175 ms
87,844 KB
testcase_16 AC 96 ms
76,700 KB
testcase_17 AC 263 ms
100,844 KB
testcase_18 AC 91 ms
76,868 KB
testcase_19 AC 210 ms
89,092 KB
testcase_20 AC 216 ms
89,372 KB
testcase_21 AC 249 ms
89,832 KB
testcase_22 AC 156 ms
86,400 KB
testcase_23 AC 285 ms
101,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


M = I()
mod = 10**9+7

div = [[] for _ in range(M+1)]
for i in range(1,M+1):
    for j in range(i,M+1,i):
        div[j].append(i)

dp = [1]*(M+1)
for i in range(2,M+1):
    for d in div[i]:
        if d == i:
            continue
        dp[i] += dp[i//d-1]
        dp[i] %= mod

ans = dp[-1]
print(ans)
0