結果

問題 No.1581 Multiple Sequence
ユーザー ああいいああいい
提出日時 2021-12-26 10:44:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 62,688 KB
最終ジャッジ日時 2023-10-24 00:43:12
合計ジャッジ時間 6,643 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,512 KB
testcase_01 AC 36 ms
53,512 KB
testcase_02 AC 326 ms
62,544 KB
testcase_03 AC 357 ms
62,604 KB
testcase_04 AC 111 ms
59,964 KB
testcase_05 AC 372 ms
62,632 KB
testcase_06 AC 170 ms
62,280 KB
testcase_07 AC 106 ms
59,952 KB
testcase_08 AC 135 ms
62,068 KB
testcase_09 AC 337 ms
62,572 KB
testcase_10 AC 221 ms
62,380 KB
testcase_11 AC 72 ms
61,768 KB
testcase_12 AC 148 ms
62,228 KB
testcase_13 AC 45 ms
59,720 KB
testcase_14 AC 360 ms
62,608 KB
testcase_15 AC 257 ms
62,444 KB
testcase_16 AC 80 ms
59,880 KB
testcase_17 AC 399 ms
62,668 KB
testcase_18 AC 66 ms
59,720 KB
testcase_19 AC 314 ms
62,536 KB
testcase_20 AC 328 ms
62,556 KB
testcase_21 AC 356 ms
62,604 KB
testcase_22 AC 202 ms
62,340 KB
testcase_23 AC 410 ms
62,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M = int(input())
P = 10 ** 9 + 7
f = [-1] * (M + 1)
f[1] = 1
f[0] = 1
for i in range(2,M+1):
    ans = 0
    j = 1
    while j * j <= i:
        if i % j == 0:
            ans = (ans + f[i//j-1]) % P
            if j != i // j:
                ans =(ans + f[j-1]) % P
        j += 1
    f[i] = ans % P
print(f[M])
0