Let be the number of valid ways to arrange the tournament among players. There are possible games among players. So the number of ways to select some games (possibly zero) from games is . Let the number of invalid ways to select the games (where every player doesn’t participate in at least one game) be . So, . Now we have to calculate the value of .
If exactly players do not participate in any game and the remaining players participate in at least one game, there are ways to choose players from and ways to arrange the games among players. So, there are ways where exactly players do not participate in any game. Now, .
Time complexity .