No.1945 Go Push!
Problem Statement
Do you know the popular toy "Go Pop!"? It comes in various shapes; one example is a toy shaped like the following.
One way to play with this toy is a game for two players.
Initially, all buttons can be pressed. A button that has been pressed cannot be pressed again.
Starting with the first player, the players alternately perform the following operation, repeating until one of them can no longer press a button.
Operation: Choose one column that still has a button that can be pressed. Press buttons that can be pressed in the chosen column. Here, if unpressed buttons are consecutive, several of them may be pressed together at once.
The player who first becomes unable to perform the operation loses. (Note: some rules differ from the real game.)
Now, as is the way of the world, once a toy sells well and becomes popular, cheap imitations start to circulate.
The enterprising DHMO has decided to create "Go Push!", an imitation of "Go Pop!".
Feeling that a misshapen appearance would hurt sales, DHMO will make it vertically symmetric.
The "Go Push!" to be created has $N$ columns, and column $i$ has $A_i$ buttons. $A_1, A_2, \ldots, A_N$ and $A_N, A_{N-1}, \ldots, A_1$ are equal sequences.
Given the input describing this "Go Push!", output which player wins under the above rules when the first and second players both play optimally.
Input
$N$ $A_1$ $A_2$ $\ldots$ $A_N$
Constraints
- $ 1 \le N \le 2\times10^{5}$
- $ 1 \le A_i \le 10^{9}$
- $A_1, A_2, \ldots, A_N$ and $A_N, A_{N-1}, \ldots, A_1$ are equal sequences
- All inputs are integers
Output
Output First if the first player wins with optimal play, or Second if the second player wins.
Print a newline at the end.
Sample
Sample 1
Input
6 3 5 6 6 5 3
Output
Second
This is the pattern in the image.
Sample 2
Input
3 1 1 1
Output
First
Sample 3
Input
7 1341907 412412 97901 295132 97901 412412 1341907
Output
First
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
H20
蜜蜂