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. lua breakpoint

    http://blog.codingnow.com/2016/11/lua_debugger.html It aims to separate debug code from host code. A ...

  2. c setjmp longjmp

    http://coolshell.cn/?s=setjmp http://www.cnblogs.com/hazir/p/c_setjmp_longjmp.html double divide(dou ...

  3. 二进制转化为十进制Java实现

    二进制转化为十进制 ①按权展开方法Java实现 /* * 按权展开法 */ public static double BinToTen1(String binary) { //查找该二进制是否存在小数 ...

  4. css 的 conic-gradient 学习

    偶然间在微信公众号奇舞周刊上看到了这篇文章<CSS Painting API>,算是对 conic-gradient的初次见面. 后来有空的时候,百度搜了一下,看了这篇文章<CSS神 ...

  5. [Leetcode]303.区域和检索&&304.二维区域和检索

    题目 1.区域和检索: 简单题,前缀和方法 乍一看就觉得应该用前缀和来做,一个数组多次查询. 实现方法: 新建一个private数组prefix_sum[i],用来存储nums前i个数组的和, 需要找 ...

  6. vs 2017 IIS EXPRESS 增加局域网访问

    在VS调试站点,默认使用IISExpress,locall+端口,为了使用IP地址.多域名调试,找到 IISExpress下的applicationhost.config,在目标站点下增加类似行: & ...

  7. Storm的acker确认机制

    Storm的acker消息确认机制... ack/fail消息确认机制(确保一个tuple被完全处理) 在spout中发射tuple的时候需要同时发送messageid,这样才相当于开启了消息确认机制 ...

  8. Android初识Helloworld

    在Eclipse+ADT中创建HelloWorld非常简单,直接按照导航下一步就可以了.本文重点不在如何创建,而在理解HelloWorld项目的文件. HelloWorld的目录结构有: src:存放 ...

  9. 关于一点儿对仓储(Repository)的理解

    仓储(Repository) 内容来源于dudu的 关于Repository模式一文 Repository是一个独立的层,介于领域层与数据映射层(数据访问层)之间.它的存在让领域层感觉不到数据访问层的 ...

  10. 前端组件化Polymer入门教程(2)——Hello world

    本节为体验篇,就是让你了解它有哪些功能,不做详细说明,后面再来讲细节. 自定义元素 组件页 <link rel="import" href="../polymer- ...