結果
| 問題 |
No.1581 Multiple Sequence
|
| コンテスト | |
| ユーザー |
yuusanlondon
|
| 提出日時 | 2021-07-02 22:06:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 226 bytes |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 63,044 KB |
| 最終ジャッジ日時 | 2024-06-29 11:38:42 |
| 合計ジャッジ時間 | 2,008 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
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)
yuusanlondon