How to calculate the number of integer sequences with the following property ?

Revision en2, by codexr3455, 2020-07-08 08:55:14

We have to calculate the number of integer-sequences of length-'n' having the 'k' properties. (B[1],B[2]......B[n])

A property is of the following type :

t1,t2,t3 (which means max(B[t1],B[t2]) should be t3)

Constraints :

1<=n,t1,t2<=15

1<=k<=225

1<=t3<=100000

Example :

Length : 2

(n = 2 )

k = 1 ,this property needs to be satisfied : max(B[1],B[2])=2 .

Answer :Number of possible sequences : 5

1)(0,2)

2)(2,0)

3)(2,2)

4)(2,1)

5)(1,2)

Tags #array

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English codexr3455 2020-07-08 10:26:20 572
en3 English codexr3455 2020-07-08 09:54:58 32 Tiny change: ')=2 . \n\nAnswer' -> ')=2 . \n\nMy idea : Seems like 2-SAT .\n\nAnswer'
en2 English codexr3455 2020-07-08 08:55:14 7
en1 English codexr3455 2020-07-08 08:54:22 577 Initial revision (published)