結果

問題 No.1011 Infinite Stairs
ユーザー tanon710tanon710
提出日時 2020-05-04 18:29:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,063 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,343 ms
コンパイル使用メモリ 86,620 KB
実行使用メモリ 408,488 KB
最終ジャッジ日時 2023-09-24 11:13:49
合計ジャッジ時間 7,427 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,400 KB
testcase_01 AC 71 ms
71,308 KB
testcase_02 AC 100 ms
80,164 KB
testcase_03 AC 711 ms
262,048 KB
testcase_04 AC 194 ms
101,776 KB
testcase_05 AC 1,063 ms
408,488 KB
testcase_06 AC 72 ms
71,228 KB
testcase_07 AC 94 ms
78,504 KB
testcase_08 AC 72 ms
71,232 KB
testcase_09 AC 78 ms
76,420 KB
testcase_10 AC 89 ms
76,496 KB
testcase_11 AC 217 ms
107,400 KB
testcase_12 AC 87 ms
76,564 KB
testcase_13 AC 164 ms
95,324 KB
testcase_14 AC 82 ms
76,400 KB
testcase_15 AC 186 ms
101,112 KB
testcase_16 AC 566 ms
232,200 KB
testcase_17 AC 125 ms
85,508 KB
testcase_18 AC 356 ms
165,348 KB
testcase_19 AC 87 ms
76,188 KB
testcase_20 AC 82 ms
76,392 KB
testcase_21 AC 193 ms
110,884 KB
testcase_22 AC 300 ms
140,060 KB
testcase_23 AC 241 ms
129,828 KB
testcase_24 AC 229 ms
122,456 KB
testcase_25 AC 320 ms
147,096 KB
testcase_26 AC 133 ms
87,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
n,d,k=map(int,input().split())
dp=[[0]*(k+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
    acum=[0]
    for l in range(k):
        acum.append((acum[-1]+dp[i][l])%mod)
    for j in range(1,k+1):
        dp[i+1][j]=acum[j]-acum[max(0,j-d)]
        dp[i+1][j]%=mod
print(dp[n][k])
0