結果

問題 No.1011 Infinite Stairs
ユーザー komkompikomkompi
提出日時 2020-03-29 03:32:20
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 473 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 260,296 KB
最終ジャッジ日時 2023-09-24 11:11:01
合計ジャッジ時間 5,239 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,412 KB
testcase_01 AC 72 ms
71,484 KB
testcase_02 AC 84 ms
76,552 KB
testcase_03 AC 352 ms
260,296 KB
testcase_04 AC 105 ms
77,588 KB
testcase_05 AC 473 ms
259,164 KB
testcase_06 AC 71 ms
71,152 KB
testcase_07 AC 79 ms
76,180 KB
testcase_08 AC 71 ms
71,440 KB
testcase_09 AC 75 ms
75,968 KB
testcase_10 AC 79 ms
76,232 KB
testcase_11 AC 109 ms
77,564 KB
testcase_12 AC 80 ms
76,172 KB
testcase_13 AC 97 ms
76,952 KB
testcase_14 AC 78 ms
76,072 KB
testcase_15 AC 106 ms
77,588 KB
testcase_16 AC 269 ms
258,860 KB
testcase_17 AC 91 ms
77,192 KB
testcase_18 AC 192 ms
186,272 KB
testcase_19 AC 80 ms
75,980 KB
testcase_20 AC 78 ms
76,036 KB
testcase_21 AC 126 ms
121,284 KB
testcase_22 AC 169 ms
160,500 KB
testcase_23 AC 133 ms
130,660 KB
testcase_24 AC 138 ms
135,156 KB
testcase_25 AC 174 ms
165,608 KB
testcase_26 AC 89 ms
76,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N,d,K=map(int,input().split())

dp=[0]*(K+1)
dp[0]=1

for i in range(N):
    temp=[0]*(K+1)
    wa=dp[0]
    for j in range(1,K+1):
        #sumとってたやば
        temp[j]=wa%(10**9+7)
        wa+=dp[j]
        if j>=d:
            wa-=dp[j-d]
        
    dp=temp[:]
print(dp[-1]%(10**9+7))
0