B. Godsend

time limit per test:2 seconds
memory limit per test:256 megabytes
input:standard input
output:standard output

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?

Input

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

Next line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).

Output

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

Examples

input

4
1 3 2 3

output

First

input

2
2 2

output

Second

Note

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.

水了一天。。。

 //2017-08-22
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm> using namespace std; const int N = ;
int arr[N]; int main()
{
int n;
std::ios::sync_with_stdio(false);
while(cin>>n){
long long sum = ;
int odd = , even = ;
for(int i = ; i < n; i++){
cin>>arr[i];
sum += arr[i];
if(arr[i]&)odd++;
else even++;
}
if(sum & )cout<<"First"<<endl;
else{
if(odd == )cout<<"Second"<<endl;
else cout<<"First"<<endl;
}
} return ;
}

Codeforces841B的更多相关文章

随机推荐

  1. [转载]Java并发编程:深入剖析ThreadLocal

                原文地址:http://www.cnblogs.com/dolphin0520/p/3920407.html 想必很多朋友对ThreadLocal并不陌生,今天我们就来一起探讨 ...

  2. Spring Boot中使用Flyway来管理数据库版本

    flyway是一个开源的数据库迁移工具.类似于数据库的版本控制工具.flyway的数据库修改文件默认放在resource下的db.migration文件夹中,以V{version_number}__{ ...

  3. 56.storm 之 hello world (集群模式)

    回顾 在上一小节,我们在PWTopology1 这一个java类中注解掉了集群模式,使用本地模式大概了解一下storm的工作流程.这一节我们注解掉本地模式相关的代码,放开集群模式相关代码,并且将项目打 ...

  4. python中内建函数isinstance的用法

    语法:isinstance(object,type) 作用:来判断一个对象是否是一个已知的类型. 其第一个参数(object)为对象,第二个参数(type)为类型名(int...)或类型名的一个列表( ...

  5. 在Storm的Toplogy中设置多数据源Spout

    上代码:主要看main方法中的设置.   如下代码是一般情况下的设置方法...Trident中设置多数据源看对应的博客总结 /** * 指定多个数据源 * 数字累加求和 * 先添加storm依赖 */ ...

  6. (转)30 个实例详解 TOP 命令

    原文:http://blog.jobbole.com/112873/?utm_source=blog Linux中的top命令显示系统上正在运行的进程.它是系统管理员最重要的工具之一.被广泛用于监视服 ...

  7. 【转】28个Unix/Linux的命令行神器

    下面是Kristóf Kovács收集的28个Unix/Linux下的28个命令行下的工具(原文链接),有一些是大家熟悉的,有一些是非常有用的,有一些是不为人知的.这些工具都非常不错,希望每个人都知道 ...

  8. php -- 获取函数参数

    ----- 015-parameter.php ----- <!DOCTYPE html> <html> <head> <meta http-equiv=&q ...

  9. Vue + Element UI 实现权限管理系统 前端篇(五):国际化实现

    国际化支持 1.安装依赖 执行以下命令,安装 i18n 依赖. yarn add vue-i18n $ yarn add vue-i18n yarn add v1.9.4 warning packag ...

  10. SQL PKG示例

    CREATE OR REPLACE PACKAGE PKG_SYS_LOG IS -- Author : Li Cong -- Created : 2009-10-12 -- Purpose : 存放 ...