結果

問題 No.1011 Infinite Stairs
ユーザー amyuamyu
提出日時 2020-03-20 22:01:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 63,872 KB
最終ジャッジ日時 2024-05-08 22:02:47
合計ジャッジ時間 3,245 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,456 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 54 ms
62,208 KB
testcase_03 AC 188 ms
63,232 KB
testcase_04 AC 77 ms
63,232 KB
testcase_05 AC 260 ms
63,872 KB
testcase_06 WA -
testcase_07 AC 52 ms
61,312 KB
testcase_08 WA -
testcase_09 AC 44 ms
58,752 KB
testcase_10 AC 51 ms
60,800 KB
testcase_11 AC 81 ms
62,848 KB
testcase_12 AC 51 ms
60,672 KB
testcase_13 AC 66 ms
61,568 KB
testcase_14 AC 47 ms
59,904 KB
testcase_15 AC 74 ms
63,360 KB
testcase_16 AC 148 ms
63,744 KB
testcase_17 AC 62 ms
62,976 KB
testcase_18 AC 108 ms
62,976 KB
testcase_19 AC 50 ms
60,416 KB
testcase_20 AC 47 ms
59,904 KB
testcase_21 AC 72 ms
61,952 KB
testcase_22 AC 98 ms
63,872 KB
testcase_23 AC 77 ms
61,952 KB
testcase_24 AC 78 ms
61,568 KB
testcase_25 AC 100 ms
62,976 KB
testcase_26 AC 59 ms
61,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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