結果

問題 No.1581 Multiple Sequence
ユーザー 👑 KazunKazun
提出日時 2021-07-03 00:03:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 584 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 77,796 KB
最終ジャッジ日時 2023-09-12 00:21:11
合計ジャッジ時間 9,267 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,132 KB
testcase_01 AC 70 ms
71,320 KB
testcase_02 AC 469 ms
77,656 KB
testcase_03 AC 507 ms
77,792 KB
testcase_04 AC 175 ms
77,196 KB
testcase_05 AC 531 ms
77,796 KB
testcase_06 AC 254 ms
77,336 KB
testcase_07 AC 168 ms
77,296 KB
testcase_08 AC 211 ms
76,996 KB
testcase_09 AC 477 ms
77,596 KB
testcase_10 AC 322 ms
77,488 KB
testcase_11 AC 119 ms
77,052 KB
testcase_12 AC 221 ms
77,384 KB
testcase_13 AC 81 ms
76,596 KB
testcase_14 AC 511 ms
77,696 KB
testcase_15 AC 377 ms
77,496 KB
testcase_16 AC 132 ms
77,136 KB
testcase_17 AC 569 ms
77,504 KB
testcase_18 AC 113 ms
77,100 KB
testcase_19 AC 450 ms
77,716 KB
testcase_20 AC 468 ms
77,716 KB
testcase_21 AC 508 ms
77,616 KB
testcase_22 AC 296 ms
77,160 KB
testcase_23 AC 584 ms
77,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Divisors(N):
    N=abs(N)
    L,U=[],[]
    k=1
    while k*k <=N:
        if N%k== 0:
            L.append(k)
            if k*k!=N:
                U.append(N//k)
        k+=1
    return L+U[::-1]
#==================================================
M=int(input())
Mod=10**9+7

DP=[0]*(M+1)
DP[0]=1

for i in range(1,M+1):
    for j in Divisors(i):
        DP[i]+=DP[i//j-1]
    DP[i]%=Mod

print(DP[M])
0