Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

Count number of ways

Правка en1, от thehumbleguy, 2018-08-05 04:24:24

Given a set of integers. Divide this set into two sets s1 and s2 such that union(s1,s2) = the initial set and intersection(s1,s2) = empty set. Also the difference between any two pairs in s1 should be >= x and in s2 it has to be >=y . Count the number of ways to divide % 1e9+7.

N = [1,1e5]

values = [1,1e18]

Example: [0,2,4,7,8,11,15] x = 5 and y = 3

4 ways

[2,7,15] [0,4,8,11]

[2,8,15] [0,4,7,11]

[2,7] [0,4,8,11,15]

[2,8] [0,4,7,11,15]

if anyone has a link to this similar problem or the solution pls tell. Thanks in advance :)

Теги #combinatorics, counting

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский thehumbleguy 2018-08-05 04:24:24 579 Initial revision (published)