Number of ways to select numbers

Revision en3, by New_Beginning, 2021-01-17 16:04:25

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]

Tags #codeforces, #dynamic programing

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English 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 English New_Beginning 2021-01-17 16:04:00 6
en1 English New_Beginning 2021-01-17 16:03:04 575 Initial revision (published)