結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
d9et
|
| 提出日時 | 2020-03-20 22:03:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 325 bytes |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 402,020 KB |
| 最終ジャッジ日時 | 2024-12-15 05:53:26 |
| 合計ジャッジ時間 | 13,552 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 TLE * 1 |
ソースコード
from itertools import accumulate
n,d,k = map(int,input().split())
mod = 10**9+7
dp = [0 for i in range(k+1)]
dp[0] = 1
acc = [0]*(n+1)
for i in range(1,n+1):
acc = list(accumulate(dp))
dp[0] = 0
for j in range(1,k+1):
if j <= d:
dp[j] = acc[j-1]
else:
dp[j] = (acc[j-1]-acc[j-d-1])%mod
print(dp[-1])
d9et