結果

問題 No.1581 Multiple Sequence
ユーザー tassei903tassei903
提出日時 2021-07-02 22:34:02
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 586 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 77,792 KB
最終ジャッジ日時 2023-09-11 22:54:16
合計ジャッジ時間 9,063 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,552 KB
testcase_01 AC 70 ms
71,256 KB
testcase_02 AC 462 ms
77,436 KB
testcase_03 AC 511 ms
77,396 KB
testcase_04 AC 175 ms
76,988 KB
testcase_05 AC 538 ms
77,620 KB
testcase_06 AC 253 ms
77,472 KB
testcase_07 AC 164 ms
77,236 KB
testcase_08 AC 208 ms
77,172 KB
testcase_09 AC 479 ms
77,792 KB
testcase_10 AC 320 ms
77,456 KB
testcase_11 AC 120 ms
76,812 KB
testcase_12 AC 220 ms
77,256 KB
testcase_13 AC 83 ms
76,628 KB
testcase_14 AC 514 ms
77,672 KB
testcase_15 AC 377 ms
77,484 KB
testcase_16 AC 137 ms
77,064 KB
testcase_17 AC 569 ms
77,500 KB
testcase_18 AC 112 ms
76,792 KB
testcase_19 AC 451 ms
77,648 KB
testcase_20 AC 469 ms
77,728 KB
testcase_21 AC 507 ms
77,720 KB
testcase_22 AC 294 ms
77,320 KB
testcase_23 AC 586 ms
77,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################
p = 10**9+7
m = ni()

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

dp = [0 for i in range(m+1)]
dp[0] = 1
for i in range(1,m+1):
    z = make_divisors(i)
    #print(z)
    for j in z:
        dp[i]+=dp[j-1]
        dp[i]%=p
print(dp[-1])
0