CF1651A Playoff
题目描述
考虑一个有 $2^n$ 个运动员参加的比赛,运动员的编号从1到 $2^n$。
比赛分 $n$ 个阶段举行。在每个阶段,运动员被按编号分成两人一组。在每一组中,运动员相互竞争,其中只有一人获胜。每组选手中的获胜者进入下一阶段,重新编号,被击败的运动员被淘汰出局。
当编号为 $x$ 的运动员和编号为 $y$ 的运动员比赛时,优胜者的决定如下:
- 如果 $x+y$ 是奇数,则指数较低的运动员获胜(即,如果 $x
输入格式
第一行包含一个整数 $T$ ( $1≤T≤30$ ),表示测试样例的数量。
每个测试样例由一行组成,其中包含一个整数 $n$ ( $1≤n≤30$ )。
输出格式
对于每个测试样例,输出一个整数(比赛冠军最开始的编号)。
说明/提示
The case $ n = 3 $ is shown in the picture from the statement.
If $ n = 1 $ , then there's only one match between athletes $ 1 $ and $ 2 $ . Since $ 1 + 2 = 3 $ is an odd number, the athlete with the lower index wins. So, the athlete $ 1 $ is the winner.