Sum of distinct count of all subsets

Правка en1, от bihariforces, 2023-08-24 12:51:43

Given an array $$$arr$$$ of length $$$N$$$, find the sum of count of unique values in a subset for every subset of $$$arr$$$, modulo $$$10^9 + 7$$$.

I can see that the result depends only on frequency of distinct values, and seems like some combinatorial trick, it's a made up question but seems standard, what is the most optimal solution for length $$$N$$$ array?

Теги combinatorics, counting, dynamic programming, math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский bihariforces 2023-08-24 12:51:43 384 Initial revision (published)