Number of ways to select numbers

Правка en1, от New_Beginning, 2021-01-17 16:03:04

Suppose I have 4 rows of numbers(The row size is n)

a1, a2 , a3 ,... an

b1, b2 , b3 , ....,bn

c1, c2, c3,... cn

d1, d2, d3,... ,dn

I need to find number of ways to select numbers from each row exactly once such that a < b < c < d.

For example if rows are 2,3,4,5 3,4,5,6, 4,5,6,7, 5,6,7,8

Then one possible way is (2,4,6,8) ; select 2 from first row, 4 from second and so on.

Other than brute force , what could be another way of solving this problem? [Note: brute force cant be used if length of rows is large]

Теги #codeforces, #dynamic programing

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский New_Beginning 2021-01-17 16:04:25 2 Tiny change: 'rows are\n2,3,4,5\' -> 'rows are\n\n2,3,4,5\'
en2 Английский New_Beginning 2021-01-17 16:04:00 6
en1 Английский New_Beginning 2021-01-17 16:03:04 575 Initial revision (published)