QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#848. 组合数

統計

定义

$$ f(n, m) = \sum_{i = 0}^m\binom n i $$

其中

$$ \binom{n}{i} = \frac{n!}{i!(n-i)!} $$

给定 $l, r, m$,请你对于 $l \le n \le r$,计算出 $f(n, m)$ 的值。

答案对 $P = 10^9 + 7$ 取模。

输入格式

一行三个非负整数 $l, r, m$,保证 $m \le l \le r$。

输出格式

输出一行 $r - l + 1$ 个整数,第 $i$ 个表示 $f(l + i - 1, m)$ 的值。

样例数据

样例 1 输入

10 20 10

样例 1 输出

1024 2047 4083 8100 15914 30827 58651 109294 199140 354522 616666

样例 1 解释

该组样例的数据范围同第 8 个测试点。

子任务

对于 $100\%$ 的数据,$l, r, m \le 3\times 10^5$

测试点 $m,l,r$ 特殊限制
$1$ $\leq 1$ A
$2,3,4$ $\leq 100$ A
$5,6$ $\leq 2000$ B
$7$ $\leq 3\times 10^5$ B
$8,9$ $\leq 2000$
$10$ $\leq 3\times 10^5$

性质 A:满足 $m=l=r$

性质 B:满足 $l=r$

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.