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)↵
↵
↵
↵
↵
(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 :
↵
1)(0,2)↵
↵
2)(2,0)↵
↵
3)(2,2)↵
↵
4)(2,1)↵
↵
5)(1,2)↵
↵
↵
↵
↵