結果

問題 No.1011 Infinite Stairs
ユーザー titiatitia
提出日時 2020-03-21 03:42:15
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 277 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 482,048 KB
最終ジャッジ日時 2024-05-09 16:45:19
合計ジャッジ時間 5,841 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,224 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 58 ms
67,328 KB
testcase_03 AC 586 ms
336,384 KB
testcase_04 AC 136 ms
108,800 KB
testcase_05 AC 886 ms
482,048 KB
testcase_06 RE -
testcase_07 AC 50 ms
64,128 KB
testcase_08 RE -
testcase_09 AC 44 ms
59,136 KB
testcase_10 AC 49 ms
62,848 KB
testcase_11 AC 149 ms
118,400 KB
testcase_12 AC 47 ms
62,208 KB
testcase_13 AC 109 ms
95,360 KB
testcase_14 AC 45 ms
59,904 KB
testcase_15 AC 130 ms
106,888 KB
testcase_16 AC 423 ms
253,440 KB
testcase_17 AC 86 ms
92,352 KB
testcase_18 AC 245 ms
173,440 KB
testcase_19 AC 47 ms
62,080 KB
testcase_20 AC 43 ms
60,032 KB
testcase_21 AC 126 ms
106,240 KB
testcase_22 AC 206 ms
153,216 KB
testcase_23 AC 146 ms
115,584 KB
testcase_24 AC 154 ms
120,192 KB
testcase_25 AC 227 ms
159,360 KB
testcase_26 AC 84 ms
80,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

DP=[[0]*(K*2+1) for i in range(N+1)]
DP[0][0]=1

for i in range(N):
    for j in range(K+1):
        DP[i+1][j+1]+=DP[i][j]
        DP[i+1][j+1+d]-=DP[i][j]

        DP[i+1][j+1]+=DP[i+1][j]
        DP[i+1][j+1]%=mod

print(DP[N][K])
0