#P15844. [Bulgarian NOI 2024] 宝可梦 / pokemons

    ID: 17912 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>2024组合数学Stirling 数

[Bulgarian NOI 2024] 宝可梦 / pokemons

Problem Description

Marty wants to collect all nn different types of Pokémon. Over a period of mm 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 mm 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 mm and nn from a single line of standard input.

Output Format

Print the answer modulo 11020246311102024631 to standard output.

3 2
6

Hint

Sample 1 Explanation

If we use 11 and 22 to represent two different Pokémon types, then all possible sequences in chronological order are: {1,1,2}\{1,1,2\}, {1,2,1}\{1,2,1\}, {1,2,2}\{1,2,2\}, {2,1,1}\{2,1,1\}, {2,1,2}\{2,1,2\}, {2,2,1}\{2,2,1\}.

Subtasks

Subtask Score Additional Constraints
11 55 m,n≤8m, n \le 8
22 m,n≤19m, n \le 19
33 1010 m,n≤7000m, n \le 7000
44 55 n≤100000,m≤n+nn \le 100000, m \le n + \sqrt{n}
55 5050 n≤1500000n \le 1500000
66 2525 None

You can get the score of a subtask only if you pass all test points of that subtask.

Constraints

  • 1≤m≤10181 \le m \le 10^{18}
  • 1≤n≤1071 \le n \le 10^7

Translated by ChatGPT 5