CF1772E Permutation Game
题目描述
有一个长度为 $n$ 的仅为 $1\sim n$ 的序列,初始序列中所有的数均为红色。两个玩家依次进行以下三种操作中一种:
- 将某个数变成蓝色。
- 将所有蓝色的数重新排列(按照自己的意愿排列,红色不可进行排列,不必将所有的蓝色都交换位置)。
- 跳过此次操作。
两个玩家依次进行一次操作视为一个回合,游戏共进行 $100^{500}$ 回合。在游戏任何时刻,如果当前序列为 $\{1,2,3...,n\}$,则第一个操作的玩家胜利。如果当前序列为 $\{n,n-1,n-2...1\}$,则第二个玩家胜利。进行 $100^{500}$ 回合之后若还无人胜利,则平局。注意,两名玩家都以最优方案进行操作。他们会尽可能让自己胜利。
输入格式
第一个数为 $t$($1\le t\le10^5$)表示数据组数。
对于每一组数据,第一行一个数 $n$($3\le n\le5\cdot10^5$),表示序列长度,下一行 $n$ 个数表示初始序列。
输出格式
如果第一个操作玩家胜利,输出 ```First```,如果第二个玩家操作胜利,输出 ```Second```,平局输出 ```Tie```。
说明/提示
Let's show how the first player wins in the first example.
They should color the elements $ 3 $ and $ 4 $ blue during their first two turns, and then they can reorder the blue elements in such a way that the permutation becomes $ [1, 2, 3, 4] $ . The second player can neither interfere with this strategy nor win faster.