#P15844. [Bulgarian NOI 2024] 宝可梦 / pokemons
[Bulgarian NOI 2024] 宝可梦 / pokemons
Problem Description
Marty wants to collect all different types of Pokémon. Over a period of days, he catches exactly one Pokémon each day. His choice on each day is independent of the other days. Now he wants to know: after days, how many sequences of choices can guarantee that he has caught at least one of each different type of Pokémon.
Unfortunately, as a first-year university student, he is busy dealing with other issues (such as trivial things like opening a bank account), so he leaves this task to you.
Two plans are considered different if and only if, on some day, the Pokémon type caught in the two plans is different.
Input Format
Read two natural numbers and from a single line of standard input.
Output Format
Print the answer modulo to standard output.
3 2
6
Hint
Sample 1 Explanation
If we use and to represent two different Pokémon types, then all possible sequences in chronological order are: , , , , , .
Subtasks
| Subtask | Score | Additional Constraints |
|---|---|---|
| None |
You can get the score of a subtask only if you pass all test points of that subtask.
Constraints
Translated by ChatGPT 5