#P4176. [HNOI2006] 花仙子的魔法
[HNOI2006] 花仙子的魔法
Description
Legend says that in the primordial era when heaven and earth first formed, there was only one kind of flower in the world, called “Yuan” (yuan). Later, a Flower Fairy with magic appeared. She could add attributes to flowers, and from then on “Yuan” kept mutating, giving rise to countless diverse flowers. It is said that the Flower Fairy can exist in two-dimensional space (plane), three-dimensional space (solid), and even -dimensional space (imagination). A point in two-dimensional space can be represented by the vector , a point in three-dimensional space by , and in general, a point in -dimensional space by . The distance between two points and in -dimensional space is defined as .
In -dimensional space, every time the Flower Fairy performs magic, she chooses a reference point and an action radius , and both the position of the reference point and the size of the radius can be chosen arbitrarily. At this time, all flowers in -dimensional space whose distance to the reference point is less than will be affected by this spell. Each spell gives different attributes to the affected flowers, and the effects can be stacked.
In general, if the Flower Fairy performs spells in total, then the attributes of the flower located at any point in -dimensional space can be described by a binary string of length , . For , if the flower is affected by the -th spell, then is ; otherwise is . Obviously, different attributes correspond to different kinds of flowers. The problem is: after the Flower Fairy performs spells in -dimensional space, what is the maximum number of different kinds of flowers she can obtain?
Input Format
Contains two integers separated by a space. The first integer is the number of spells performed, and the second integer is the dimension of the space. Constraints: , .
Output Format
Output one line with a single integer representing the answer.
3 1
6
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号