結果

問題 No.1011 Infinite Stairs
ユーザー komkompi
提出日時 2020-03-29 03:27:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 333 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 22,528 KB
最終ジャッジ日時 2025-01-02 12:58:31
合計ジャッジ時間 50,878 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 15
権限があれば一括ダウンロードができます

ソースコード

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]=sum(dp[max(j-d,0):j])
        wa+=dp[j]
        if j>=d:
            wa-=dp[j-d]
    dp=temp[:]
print(dp[-1]%(10**9+7))
0