pal550's blog

By pal550, history, 23 months ago, In English

Hi all, Problem

Constraint:

1 <= N <= 100000
 1 <= A[i] <= 10^9

Please help me in this problem. Thanks in advance.

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

| Write comment?
»
23 months ago, # |
  Vote: I like it +6 Vote: I do not like it

Calculate the total number of distinct elements in the array. Let it be $$$X$$$. The answer is simply $$$N choose X$$$ because we can simply distribute in the order of increasing values and there is one such distribution only