結果
| 問題 | No.1011 Infinite Stairs |
| コンテスト | |
| ユーザー |
koheijkt
|
| 提出日時 | 2026-05-15 09:13:25 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 557 ms / 2,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 84,900 KB |
| 実行使用メモリ | 260,956 KB |
| 最終ジャッジ日時 | 2026-05-15 09:13:32 |
| 合計ジャッジ時間 | 5,828 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
from itertools import accumulate
N, d, K = map(int, input().split())
limit = d*N
prevdp = [0] * (limit + 1)
prevdp[0] = 1
MOD = 10**9+7
for i in range(1, N + 1):
dp = [0] * (limit + 1)
#rui = list(accumulate(prevdp, initial=0))
rui = [0]
for j in range(limit + 1):
rui.append((rui[-1] + prevdp[j])%MOD)
for j in range(i, d*i + 1):
dp[j] = (rui[j] - rui[max(0, j - d)])%MOD
prevdp = dp
#print(dp)
ans = dp[K]
print(ans)
koheijkt