結果

問題 No.1877 俺自身が線グラフになることだ
ユーザー tassei903tassei903
提出日時 2022-03-19 09:13:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 76,380 KB
最終ジャッジ日時 2024-04-14 22:02:29
合計ジャッジ時間 1,958 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,544 KB
testcase_01 AC 39 ms
53,120 KB
testcase_02 AC 39 ms
52,408 KB
testcase_03 AC 37 ms
53,056 KB
testcase_04 AC 39 ms
52,920 KB
testcase_05 AC 38 ms
53,076 KB
testcase_06 AC 38 ms
53,332 KB
testcase_07 AC 39 ms
53,024 KB
testcase_08 AC 38 ms
53,552 KB
testcase_09 AC 39 ms
53,160 KB
testcase_10 AC 48 ms
61,908 KB
testcase_11 AC 104 ms
76,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n = ni()
mod = 10**9+7
dp = [0]*(n+1)
dp[-1] = 1
for i in range(3,n+1):
    ndp = [0]*(n+1)
    ndp, dp = dp, ndp
    for j in range(n+1):
        for k in range(j, -1, -i):
            dp[k] += ndp[j]
            dp[k] %= mod
    #print(dp)
print(dp[0])
0