結果

問題 No.1011 Infinite Stairs
ユーザー NoneNone
提出日時 2021-02-26 17:32:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,728 KB
実行使用メモリ 219,924 KB
最終ジャッジ日時 2024-04-10 07:27:15
合計ジャッジ時間 21,224 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 707 ms
219,100 KB
testcase_06 AC 710 ms
218,952 KB
testcase_07 WA -
testcase_08 AC 721 ms
219,460 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #



###################################################
def example():
    global input
    example = iter(
        """
300 300 90000


        """
            .strip().split("\n"))
    input = lambda: next(example)
###################################################

import sys
input = sys.stdin.readline
from bisect import bisect_left, bisect_right

example()

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

dp=[0]*(K+2)
dp[0]=1
for n in range(1,N+1):
    for k in range(min((n-1)*d,K)+1)[::-1]:
        dp[k+1]+=dp[k]
        dp[min(k+d,K)+1]-=dp[k]
        dp[k]=0
    acc=[0]
    for a in dp:
        acc.append((acc[-1]+a)%MOD)
    dp=acc[1:]

print(dp[K]%MOD)
0