#P10200. [湖北省选模拟 2024] 花神诞日 / sabzeruz
[湖北省选模拟 2024] 花神诞日 / sabzeruz
Background
Legend says that the reason this day is called “Flower Goddess’s Birthday” is that it originally meant “celebrating the Flower Goddess.”
A long, long time ago, the Tree King (Lady) had a birthday. Her friends held a banquet to celebrate it.
At the banquet, several gods got drunk. One of them, in high spirits, started playing an instrument. Then the Tree King began to sing, and the Flower Goddess started to dance.
As the Flower Goddess danced, countless beautiful Patishalan grew on the grass she stepped on...
Ah, if only time could stay at that moment forever.
Problem Description
You are preparing a banquet for the Flower Goddess’s Birthday. You have kinds of ingredients, numbered in order. The flavor of ingredient is , and the flavors of any two ingredients are all different. You want to use these ingredients to make two dishes. Each ingredient must be used in exactly one dish. Each dish must use at least one ingredient.
In the same dish, the flavors of different ingredients will react pairwise. If ingredient reacts with ingredient , it produces a flavor of , where denotes the XOR operation. The final flavor of a dish is the minimum among all flavors produced by these pairwise reactions. For example, if a dish uses three ingredients with flavors , then the pairwise reactions produce three flavors: , , and . The flavor of this dish is .
The “original” flavor is the most delicious. If a dish uses only one ingredient, then the flavor of this dish is .
You want the flavor of the first dish to be at least , and the flavor of the second dish to be at least . How many different cooking plans are there?
Note: using the same set of ingredients but swapping which one is the first dish and which one is the second dish counts as two different plans. For example, “dish 1 uses ingredients and dish 2 uses ” and “dish 1 uses and dish 2 uses ” are considered two different plans.
Since the answer may be very large, you only need to output the answer modulo .
Input Format
The input has two lines.
The first line contains three positive integers , representing the number of ingredient types, and the required flavor thresholds for the first and second dish.
The second line contains positive integers , where is the flavor of ingredient .
Output Format
Output one line with one integer, representing the number of cooking plans modulo .
2 10 10
1 2
2
4 2 5
5 3 1 4
5
见选手目录下的 sabzeruz/sabzeruz3.in 与 sabzeruz/sabzeruz3.ans。
该样例符合测试点 9 ∼ 11 的限制。
见选手目录下的 sabzeruz/sabzeruz4.in 与 sabzeruz/sabzeruz4.ans。
该样例符合测试点 12 ∼ 15 的限制。
见选手目录下的 sabzeruz/sabzeruz5.in 与 sabzeruz/sabzeruz5.ans。
Hint
Sample Explanation 2
The five cooking plans are listed below:
- Dish 1 uses ingredients , and dish 2 uses ingredient .
- Dish 1 uses ingredients , and dish 2 uses ingredients .
- Dish 1 uses ingredients , and dish 2 uses ingredients .
- Dish 1 uses ingredients , and dish 2 uses ingredient .
- Dish 1 uses ingredients , and dish 2 uses ingredients .
Subtasks
For all testdata, it is guaranteed that , . For any , .
| Test Point ID | Special Property | |
|---|---|---|
| None | ||
| A | ||
| None | ||
| A | ||
| B | ||
| None |
Special Property A: it is guaranteed that .
Special Property B: it is guaranteed that .
Translated by ChatGPT 5