結果
| 問題 |
No.1011 Infinite Stairs
|
| コンテスト | |
| ユーザー |
uni_python
|
| 提出日時 | 2020-07-12 23:03:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,230 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 295 ms |
| コンパイル使用メモリ | 82,012 KB |
| 実行使用メモリ | 247,592 KB |
| 最終ジャッジ日時 | 2024-07-17 12:11:29 |
| 合計ジャッジ時間 | 6,821 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def main():
mod=10**9+7
N,d,K=MI()
dp=[0]*(1+K)
dp[0]=1
for i in range(N):
S=[0]*(K+1)
for j in range(K):
S[j+1]=(S[j]+dp[j])%mod
for j in range(K,-1,-1):
dp[j]=(S[j]-S[max(0,j-d)])%mod
print(dp[-1])
main()
uni_python