結果

問題 No.1581 Multiple Sequence
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-01 19:37:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 78,484 KB
最終ジャッジ日時 2023-09-02 02:33:48
合計ジャッジ時間 9,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,840 KB
testcase_01 AC 67 ms
71,568 KB
testcase_02 AC 427 ms
78,236 KB
testcase_03 AC 469 ms
78,280 KB
testcase_04 AC 165 ms
77,944 KB
testcase_05 AC 480 ms
78,384 KB
testcase_06 AC 235 ms
77,996 KB
testcase_07 AC 159 ms
77,892 KB
testcase_08 AC 193 ms
78,052 KB
testcase_09 AC 441 ms
78,144 KB
testcase_10 AC 296 ms
77,976 KB
testcase_11 AC 113 ms
77,792 KB
testcase_12 AC 207 ms
77,788 KB
testcase_13 AC 80 ms
77,196 KB
testcase_14 AC 469 ms
78,484 KB
testcase_15 AC 343 ms
78,248 KB
testcase_16 AC 123 ms
77,532 KB
testcase_17 AC 524 ms
78,164 KB
testcase_18 AC 105 ms
77,780 KB
testcase_19 AC 421 ms
78,360 KB
testcase_20 AC 435 ms
78,436 KB
testcase_21 AC 469 ms
78,200 KB
testcase_22 AC 273 ms
78,156 KB
testcase_23 AC 543 ms
78,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

m = int(input())
mod = 10**9+7
dp = [0]*(m+1)
dp[0] = 1
for n in range(1, m+1):
    D = make_divisors(n)
    for i in D:
        dp[n] += dp[n//i-1]
        dp[n] %= mod
print(dp[m]%mod)
0