結果

問題 No.1011 Infinite Stairs
ユーザー titiatitia
提出日時 2020-03-21 03:46:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 674 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 289,896 KB
最終ジャッジ日時 2023-09-24 11:04:08
合計ジャッジ時間 6,424 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,464 KB
testcase_01 AC 72 ms
71,276 KB
testcase_02 AC 86 ms
76,412 KB
testcase_03 AC 479 ms
216,052 KB
testcase_04 AC 151 ms
92,996 KB
testcase_05 AC 674 ms
289,896 KB
testcase_06 AC 73 ms
71,412 KB
testcase_07 AC 84 ms
76,008 KB
testcase_08 AC 73 ms
71,364 KB
testcase_09 AC 78 ms
76,240 KB
testcase_10 AC 84 ms
76,072 KB
testcase_11 AC 161 ms
92,928 KB
testcase_12 AC 83 ms
76,276 KB
testcase_13 AC 134 ms
92,756 KB
testcase_14 AC 80 ms
76,168 KB
testcase_15 AC 149 ms
92,976 KB
testcase_16 AC 355 ms
174,376 KB
testcase_17 AC 101 ms
76,492 KB
testcase_18 AC 239 ms
132,668 KB
testcase_19 AC 83 ms
76,116 KB
testcase_20 AC 78 ms
75,976 KB
testcase_21 AC 146 ms
99,052 KB
testcase_22 AC 213 ms
122,912 KB
testcase_23 AC 158 ms
103,680 KB
testcase_24 AC 166 ms
105,936 KB
testcase_25 AC 220 ms
125,388 KB
testcase_26 AC 108 ms
76,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

DP=[[0]*(K+d+2) 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