結果

問題 No.1581 Multiple Sequence
ユーザー yuusanlondonyuusanlondon
提出日時 2021-07-02 22:06:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 77,732 KB
最終ジャッジ日時 2023-09-11 22:01:56
合計ジャッジ時間 4,323 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,080 KB
testcase_01 AC 70 ms
71,252 KB
testcase_02 AC 85 ms
77,448 KB
testcase_03 AC 86 ms
77,648 KB
testcase_04 AC 84 ms
76,556 KB
testcase_05 AC 89 ms
77,620 KB
testcase_06 AC 83 ms
76,852 KB
testcase_07 AC 80 ms
76,652 KB
testcase_08 AC 80 ms
76,748 KB
testcase_09 AC 86 ms
77,408 KB
testcase_10 AC 84 ms
77,036 KB
testcase_11 AC 78 ms
75,992 KB
testcase_12 AC 82 ms
76,896 KB
testcase_13 AC 78 ms
76,052 KB
testcase_14 AC 88 ms
77,400 KB
testcase_15 AC 83 ms
77,168 KB
testcase_16 AC 79 ms
76,228 KB
testcase_17 AC 86 ms
77,448 KB
testcase_18 AC 78 ms
76,128 KB
testcase_19 AC 85 ms
77,288 KB
testcase_20 AC 88 ms
77,496 KB
testcase_21 AC 86 ms
77,388 KB
testcase_22 AC 81 ms
77,100 KB
testcase_23 AC 88 ms
77,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=10**9+7
m=int(input())
dp=[0]*(m+1)
dp2=[0]*(m+1)
dp[1]=1
for i in range(1,m):
  dp[i+1]=(dp[i]+dp2[i]+dp[i+1])%MOD
  curr=2
  while curr*i<m+1:
    dp2[curr*i]=(dp2[curr*i]+dp[i])%MOD
    curr+=1
print((dp[m]+dp2[m])%MOD)
0