結果

問題 No.1011 Infinite Stairs
ユーザー c-yanc-yan
提出日時 2020-03-21 00:17:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 79,532 KB
最終ジャッジ日時 2023-09-24 11:03:26
合計ジャッジ時間 4,238 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,104 KB
testcase_01 AC 77 ms
71,272 KB
testcase_02 AC 85 ms
76,300 KB
testcase_03 AC 142 ms
78,432 KB
testcase_04 AC 173 ms
78,124 KB
testcase_05 AC 176 ms
79,532 KB
testcase_06 AC 76 ms
71,296 KB
testcase_07 AC 90 ms
76,608 KB
testcase_08 AC 73 ms
71,296 KB
testcase_09 AC 75 ms
71,488 KB
testcase_10 AC 82 ms
76,280 KB
testcase_11 AC 118 ms
77,488 KB
testcase_12 AC 80 ms
76,336 KB
testcase_13 AC 101 ms
76,792 KB
testcase_14 AC 83 ms
75,988 KB
testcase_15 AC 95 ms
76,884 KB
testcase_16 AC 145 ms
78,476 KB
testcase_17 AC 149 ms
77,744 KB
testcase_18 AC 109 ms
77,576 KB
testcase_19 AC 78 ms
75,992 KB
testcase_20 AC 79 ms
76,172 KB
testcase_21 AC 95 ms
76,884 KB
testcase_22 AC 140 ms
77,960 KB
testcase_23 AC 97 ms
77,048 KB
testcase_24 AC 97 ms
76,960 KB
testcase_25 AC 108 ms
77,532 KB
testcase_26 AC 84 ms
76,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, d, K = map(int, input().split())

buf0 = [0] * (d * N + K + 1)
buf1 = [0] * (d * N + K + 1)
buf0[0] = 1

for i in range(N):
    t = 0
    for j in range(d):
        t += buf0[j]
        t %= 1000000007
        buf1[j] = t
    for j in range(d, (i + 1) * d):
        t -= buf0[j - d]
        t += buf0[j]
        t %= 1000000007
        buf1[j] = t
    buf0, buf1 = buf1, buf0

print(buf0[K - N])
0