問題一覧 > 通常問題

No.1011 Infinite Stairs

レベル : / AI推定難易度 : 1050 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 271
作問者 : otamay6 / テスター : Lemma299 polylogK
お気に入りにしたユーザー ProblemId : 3663 / 自分の提出
問題文最終更新日: 2020-03-13 21:03:59
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 241 (順位表) の他の問題:

Problem Statement

There is an infinitely long staircase. You are initially on step $0$ and intend to repeat the following action $N$ times.
・When you are on step $i$, move to one of steps $i+1$, $i+2$, $\dots$ , $i+d$
Find the number of ways of moving such that you arrive at step $K$ after $N$ moves.
Since the answer can be very large, find the remainder when it is divided by $10^9+7$

Input

$N\ d\ K$

All inputs are given as integers
$1 \le N,d \le 300$
$N \le K \le d \times N$

Output

Output the number of ways of moving such that you arrive at step $K$ after $N$ moves.
Print a newline at the end.

Sample

Sample 1
Input
3 2 5
Output
3

There are 3 ways of moving: (2,2,1), (2,1,2), (1,2,2)

Sample 2
Input
6 3 10
Output
90

Among the possible ways of moving, those in ascending order are the 3 ways (1,1,1,1,3,3), (1,1,1,2,2,3), (1,1,2,2,2,2), and the number of rearrangements of any of these is
${}_{6}{\rm C}_{2}$ + ${}_{6}{\rm C}_{3}\times {}_{3}{\rm C}_{2}$ + ${}_{6}{\rm C}_{2}$ = 90 ways

Sample 3
Input
256 12 1444
Output
866273184

Output the remainder of the answer when divided by $10^9+7$

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。