QOJ.ac

QOJ

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

#844. 空间切割

الإحصائيات

如果你认为空间的概念是模糊的,那么在此处给出本题中对空间严格的数学概念。

你可以认为一个这样的“截面”是在欧式空间 $\mathbb R^k$ 中的一个 $k$ 维向量 $\mathbf a \neq \mathbf 0$ 和实数 $\lambda$ 组成记为 $(\mathbf a, \lambda)$,其“截面”上的点集合即 $H_i = \left\{ \mathbf x \in \mathbb R^k \middle\vert \mathbf a \cdot \mathbf x = \lambda \right\}$,而这对剩余部分的空间产生了一个割 $(L_i, R_i)$ 其中 $L_i = \left\{ \mathbf x \in \mathbb R^k \middle\vert \mathbf a \cdot \mathbf x < \lambda \right\}, R_i = \left\{ \mathbf x \in \mathbb R^k \middle\vert \mathbf a \cdot \mathbf x > \lambda \right\}$。

那么对于整个空间切成的“块”的集族就是

$$\left\{ \bigcap_{i = 1}^n B_i \neq \emptyset \middle\vert B \in \{L_1, R_1\} \times \{L_2, R_2\} \times \cdots \times \{L_n, R_n\} \right\}$$


一条直线可以被一些点切成两条射线和一些线段。一个平面可以被若干条直线分割成一些片。一个3维空间可以被若干个平面分割成一些空间……

现在请你帮忙计算在一个 $k$ 维空间中,总共 $n$ 个 $k-1$ 维的截“面”最多可以将这个空间分割成了多少个部分。

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

输入格式

一行两个正整数 $k, n$ 表示维度和截“面”数量。

输出格式

输出答案。

样例数据

样例 1 输入

2 3

样例 1 输出

7

样例 2 输入

3 3

样例 2 输出

8

样例 3 输入

123 321

样例 3 输出

833554445

样例 4 输入

999800 1000000

样例 4 输出

32983392

子任务

对于 $100\%$ 的数据,保证 $k, n \le 10^6$

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.