Subingbupt's blog

By Subingbupt, 3 months ago, In English

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.

  • Vote: I like it
  • +14
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Seems very hard. Where is this from?

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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