301782: CF336E. Vasily the Bear and Painting Square

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Vasily the Bear and Painting Square

题意翻译

按照以下规则生成一个规模为n的图形: 1.在直角坐标系xoy中,画4条线段:$[(0,0),(2^n,0)]$, $[(0,0),(-2^n, 0)]$,$[(0,0), (0,2^n)]$, $[(0, 0),(0,-2^n)]$ 2.对于所有的$i = 1, 2, ......, n$,画两个正方形,一个以$(0,2^i)$,$ (0,-2^i)$,$(2^i,0)$, $(-2^i,0)$为顶点,另一个以$(-2^{(i-1)},-2^{(i-1)})$,$(-2^{(i-1)},2^{(i-1)})$, $(2^{(i-1)},-2^{(i-1)})$ $(2^{(i-1)},2^{(i-1)})$ 为顶点。 3.画一个以$(1,0)$, $(-1,0)$, $(0,-1)$, $(0,1)$ 为顶点的正方形。 现要将这个图形中,用k种不同的颜色涂出k个互不重叠的三角形。问有多少种不同的方法模$1000000007$。 只有本来所有相同位置的三角形被涂的颜色相同才算是相同的方案。 Translated by @rilisoft

题目描述

Vasily the bear has two favorite integers $ n $ and $ k $ and a pencil. Besides, he's got $ k $ jars with different water color paints. All jars are numbered in some manner from $ 1 $ to $ k $ , inclusive. The jar number $ i $ contains the paint of the $ i $ -th color. Initially the bear took a pencil and drew four segments on the coordinate plane. All of them end at point $ (0,0) $ . They begin at: $ (0,2^{n}) $ , $ (0,-2^{n}) $ , $ (2^{n},0) $ , $ (-2^{n},0) $ . Then for each $ i=1,2,...,n $ , the bear drew two squares. The first square has the following vertex coordinates: $ (2^{i},0) $ , $ (-2^{i},0) $ , $ (0,-2^{i}) $ , $ (0,2^{i}) $ . The second square has the following vertex coordinates: $ (-2^{i-1},-2^{i-1}) $ , $ (-2^{i-1},2^{i-1}) $ , $ (2^{i-1},-2^{i-1}) $ , $ (2^{i-1},2^{i-1}) $ . After that, the bear drew another square: $ (1,0) $ , $ (-1,0) $ , $ (0,-1) $ , $ (0,1) $ . All points mentioned above form the set of points $ A $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF336E/181ebcd986175c2f3adb2eae120adaf1e5f14854.png) The sample of the final picture at $ n=0 $ ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF336E/e6cc4ea6655f30f4cc22f6f5a70b90a16e22032c.png) The sample of the final picture at $ n=2 $ The bear decided to paint the resulting picture in $ k $ moves. The $ i $ -th move consists of the following stages: 1. The bear chooses 3 distinct points in set $ А $ so that any pair of the chosen points has a segment on the picture between them. The chosen points and segments mark the area that mustn't contain any previously painted points. 2. The bear paints the area bounded by the chosen points and segments the $ i $ -th color. Note that after the $ k $ -th move some parts of the picture can stay unpainted. The bear asked you to calculate, how many distinct ways there are to paint his picture. A way to paint the picture is a sequence of three-element sets of points he chose on each step. Two sequences are considered distinct if there is such number $ i $ ( $ 1<=i<=k) $ , that the $ i $ -th members of these sequences do not coincide as sets. As the sought number can be rather large, you only need to calculate the remainder after dividing it by number $ 1000000007 $ ( $ 10^{9}+7 $ ).

输入输出格式

输入格式


The first line contains two integers $ n $ and $ k $ , separated by a space ( $ 0<=n,k<=200 $ ).

输出格式


Print exactly one integer — the answer to the problem modulo $ 1000000007 $ ( $ 10^{9}+7 $ ).

输入输出样例

输入样例 #1

0 0

输出样例 #1

1

输入样例 #2

0 1

输出样例 #2

8

输入样例 #3

0 2

输出样例 #3

32

输入样例 #4

1 1

输出样例 #4

32

Input

题意翻译

按照以下规则生成一个规模为n的图形: 1.在直角坐标系xoy中,画4条线段:$[(0,0),(2^n,0)]$, $[(0,0),(-2^n, 0)]$,$[(0,0), (0,2^n)]$, $[(0, 0),(0,-2^n)]$ 2.对于所有的$i = 1, 2, ......, n$,画两个正方形,一个以$(0,2^i)$,$ (0,-2^i)$,$(2^i,0)$, $(-2^i,0)$为顶点,另一个以$(-2^{(i-1)},-2^{(i-1)})$,$(-2^{(i-1)},2^{(i-1)})$, $(2^{(i-1)},-2^{(i-1)})$ $(2^{(i-1)},2^{(i-1)})$ 为顶点。 3.画一个以$(1,0)$, $(-1,0)$, $(0,-1)$, $(0,1)$ 为顶点的正方形。 现要将这个图形中,用k种不同的颜色涂出k个互不重叠的三角形。问有多少种不同的方法模$1000000007$。 只有本来所有相同位置的三角形被涂的颜色相同才算是相同的方案。 Translated by @rilisoft

加入题单

上一题 下一题 算法标签: