結果

問題 No.1581 Multiple Sequence
ユーザー 👑 KazunKazun
提出日時 2021-07-02 22:31:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 585 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 77,732 KB
最終ジャッジ日時 2023-09-11 22:49:13
合計ジャッジ時間 9,887 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
71,504 KB
testcase_01 AC 78 ms
71,504 KB
testcase_02 AC 465 ms
77,464 KB
testcase_03 AC 505 ms
77,480 KB
testcase_04 AC 180 ms
77,140 KB
testcase_05 AC 530 ms
77,732 KB
testcase_06 AC 256 ms
77,268 KB
testcase_07 AC 171 ms
77,088 KB
testcase_08 AC 209 ms
77,016 KB
testcase_09 AC 476 ms
77,648 KB
testcase_10 AC 323 ms
77,376 KB
testcase_11 AC 124 ms
77,000 KB
testcase_12 AC 225 ms
77,320 KB
testcase_13 AC 89 ms
76,408 KB
testcase_14 AC 510 ms
77,476 KB
testcase_15 AC 373 ms
77,556 KB
testcase_16 AC 136 ms
77,148 KB
testcase_17 AC 566 ms
77,672 KB
testcase_18 AC 116 ms
76,904 KB
testcase_19 AC 473 ms
77,528 KB
testcase_20 AC 464 ms
77,628 KB
testcase_21 AC 502 ms
77,720 KB
testcase_22 AC 299 ms
77,296 KB
testcase_23 AC 585 ms
77,684 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())

if M==1:
    exit(print(1))

K=max(20,M+3)
Mod=10**9+7

B=[1]*K
for i in range(2,K):
    for j in Divisors(i-1):
        if j>1:
            B[i]+=B[j]
    B[i]%=Mod

print(B[M+1]%Mod)
0