QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 256 MB Puntuación total: 100

#844. 空間切割

Estadísticas

如果你認為空間的概念是模糊的,那麼在此處給出本題中對空間嚴格的數學概念。

你可以認為一個這樣的「截面」是在歐式空間 $\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$

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.