Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Finding least difference between max and min value of all possible sets of numbers

Правка en1, от NODE_SM, 2022-07-20 15:06:48

There are n arrays of k size each. a0[0],a0[1],......a0[k-1] a1[0],a1[1],......a1[k-1] . . . an-1[0],an-1[1], .... an-1[k-1] Now a Set of size n is constructed by taking any value randomly from each of the arrays. e.g one such set can be {a0[0],a1[3],a2[2],.... an-1[k-1]} My goal is to find out the min and max elements in all possible Sets such that the difference between the min and max is the lowest.

Теги minheap, 2d arrays, dynamic programming

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский NODE_SM 2022-07-20 15:07:39 808
en1 Английский NODE_SM 2022-07-20 15:06:48 499 Initial revision (published)