CF841B.Godsend

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players move one by one. The first player can choose for his move a subsegment of non-zero length with an odd sum of numbers and remove it from the array, after that the remaining parts are glued together into one array and the game continues. The second player can choose a subsegment of non-zero length with an even sum and remove it. Loses the one who can not make a move. Who will win if both play optimally?

列哈不知怎么发现了一个由 nn 个整数组成的数组。他看着这个数组,想出了一个游戏规则:两名玩家在该数组上进行博弈,轮流行动。先手玩家每次可以选择一个长度非零、元素和为奇数的连续子段(即子数组)将其从数组中移除;移除后,剩余的左右两部分将拼接成一个新的连续数组,游戏继续进行。后手玩家每次则必须选择一个长度非零、元素和为偶数的连续子段将其移除。无法进行合法移动的一方判负。若双方均采取最优策略,谁将获胜?

输入格式

First line of input data contains single integer n (1 ≤ n ≤ 106) — length of the array.

Next line contains n integers _a_1, _a_2, ..., a__n (0 ≤ a__i ≤ 109).

输入数据的第一行包含一个整数 nn(1≤n≤1061 \leq n \leq 10^6)—— 数组的长度。

第二行包含 nn 个整数 a1,a2,…,ana_1, a_2, \ldots, a_n(0≤ai≤1090 \leq a_i \leq 10^9)。

输出格式

Output answer in single line. "First", if first player wins, and "Second" otherwise (without quotes).

单行输出答案:“First”表示先手玩家获胜,“Second”表示后手玩家获胜(不带引号)。

输入输出样例

  • 输入#1

    4
    1 3 2 3

    输出#1

    First
  • 输入#2

    2
    2 2

    输出#2

    Second

说明/提示

In first sample first player remove whole array in one move and win.

In second sample first player can't make a move and lose.

在第一个样例中,先手玩家一步移除整个数组并获胜。

在第二个样例中,先手玩家无法进行任何操作,因此失败。

输入解题思路,AI测评打分。不知道怎么写?

首页