Блог пользователя Subingbupt

Автор Subingbupt, 2 месяца назад, По-английски

There are n distinct integers. a1, a2, ..., an (1 <= n <= 1e5) a1 < a2 < ... < an (1 <= ai <= 1e5) And there is an integer k (k <= 1e5) I will choose n integers. b1, b2, ..., bn, ai <= bi <= k for i = 1, 2, ..., n For each choosing method, there is a product, the product of the factorial of each number's occurence. I want to calculate the sum of these products.

For example:

n == 3

k == 4

[1, 3, 4]

Then, the answer is 18.

I don't know how to solve it.

  • Проголосовать: нравится
  • +14
  • Проголосовать: не нравится

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Seems very hard. Where is this from?

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

me too. alas, difficulty is necessary as it strengthens our skills.