BINTOUR March 2014

please someone explain the question bintour in march challenge 2014 or it’s test cases

2 Likes

Well it’s very difficult to explain the whole problem again, instead you can tell which part you couldn’t understand.

1 Like

The Question is something like this. You are given that in a tournament where are 2^k players where k is given as the input you have to find out the number permutations in which player i (i varying from 1 to 2^k) gets to the final round.

Examples :

k = 2
then there are 4 players 1,2,3,4.
So for

Player 1 :
There are no permutations in which he gets to the final round.

Player 2 :
The possible permutations in which he gets to the final round are

1,2,3,4 Player 1 and 2 play where player 2 wins and then he enters the final round with player 4

2,1,3,4 Player 1 and 2 play where player 2 wins and then he enters the final round with player 4

1,2,4,3 " "

2,1,4,3 " "

4,3,2,1 " "

4,3,1,2 " "

3,4,1,2 " "

3,4,2,1 " "

So 8 cases and similarly for other

2 Likes

sir if j<=2^(k-i) then if i=1 and k=2 then value of j can be 1 and 2 but if j =2 then battle will be in knights standing at position 2j i.e 4 and 2j+1 i.e 5 but maximum value can be 4 so how is this poosible

1 Like

thnks … i understand that sir the problem is that position are given as 2j and 2j +1 so if j=1 then the match will be in 2 and 3 and when j=2 the match will be in 4 and 5 but how is this poosible accoding to my understanding and your example i think the match is in between 1st and 2nd , 3rd and 4th knight

1 Like

Actually I was doing the same mistake ,just start the j from 0 not 1
it really solves the problem :smiley:

1 Like