結果

問題 No.1011 Infinite Stairs
ユーザー NagisaNagisa
提出日時 2020-03-20 22:55:41
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 378 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 259,584 KB
最終ジャッジ日時 2024-05-08 23:47:12
合計ジャッジ時間 5,668 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 72 ms
72,064 KB
testcase_03 AC 620 ms
258,544 KB
testcase_04 AC 123 ms
77,056 KB
testcase_05 AC 770 ms
257,636 KB
testcase_06 AC 40 ms
51,584 KB
testcase_07 AC 64 ms
67,712 KB
testcase_08 RE -
testcase_09 AC 46 ms
58,368 KB
testcase_10 AC 63 ms
65,536 KB
testcase_11 AC 136 ms
77,696 KB
testcase_12 AC 61 ms
64,896 KB
testcase_13 AC 107 ms
76,544 KB
testcase_14 AC 52 ms
61,184 KB
testcase_15 AC 122 ms
77,440 KB
testcase_16 AC 401 ms
259,584 KB
testcase_17 AC 89 ms
76,032 KB
testcase_18 AC 290 ms
230,528 KB
testcase_19 AC 60 ms
64,896 KB
testcase_20 AC 54 ms
62,208 KB
testcase_21 AC 153 ms
130,304 KB
testcase_22 AC 251 ms
200,576 KB
testcase_23 AC 172 ms
143,872 KB
testcase_24 AC 182 ms
150,912 KB
testcase_25 AC 264 ms
208,768 KB
testcase_26 AC 89 ms
76,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
N, d, K = map(int,input().split())

dp = [0]*(K+1)
for k in range(1,d+1):
    dp[k] = 1

for i in range(N-1):
    s = [0]*(K+1)
    for j in range(1,K+1):
        s[j] = s[j-1] + dp[j]
        s[j] %= MOD
#    print(s)
    new = [0]*(K+1)
    for j in range(i+1,K+1):
        new[j] = s[j-1] - s[max(0,j-d-1)]
        new[j] %= MOD
    dp = new[::]
print(dp[K])
0