No.761 Average Game
タグ : / 解いたユーザー数 71
作問者 :
butsurizuki
/ テスター :
matsu7874
Note
This is the problem for day 9 of Advent Calendar Contest 2018.
Problem
Butsurizuki-san came up with the following game.
First, prepare $N$ natural numbers $A_i$.
A player can perform one of the following operations.
(i) Delete all natural numbers that are greater than or equal to the average.
(ii) Delete all natural numbers that are less than the average.
Starting with the first player, the players take turns performing an operation, and the player who first becomes unable to perform an operation loses.
Note that an operation that deletes no numbers cannot be performed.
Input
$N$ $A_1$ $A_2$ $...$ $A_N$
・Constraints
$1 \le N \le 10^5$
$1 \le A_i \le 10^{12}(1 \le i \le N)$
$A_i \le A_{i+1}(1 \le i < N)$
Output
Print First if the first player wins and Second if the second player wins, followed by a newline.
Sample
Sample 1
Input
5 1 2 3 5 8
Output
First
If the first player deletes 1,2,3 first, then whichever of 5,8 the second player deletes, the first player can win by deleting the other one.
Sample 2
Input
7 1 3 3 4 575 1333 1640
Output
Second
Sample 3
Input
1 20181209
Output
First
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。