题目链接:http://codeforces.com/problemset/problem/841/B

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.

题解:和为奇数第一个赢 和为偶数 没有奇数的话第二个赢 否则 还是第一个赢

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
#define ll long long
const int N=;
int main()
{
int n,k;
while(cin>>n){
int t=;
ll sum=;
for(int i=;i<n;i++){
cin>>k;
sum+=k;
if(k%==) t=;
}
if(sum%==) cout<<"First"<<endl;
else {
if(!t) cout<<"Second"<<endl;
else cout<<"First"<<endl;
}
}
return ;
}

最新文章

  1. Windows Phone 8.1 新特性 - 常用的启动器
  2. codeforces 732
  3. Linux ubuntu 10.10安装OpenCv
  4. windows装liunx双系统
  5. Storyboards vs NIB vs Code 大辩论
  6. hdu 4570 Multi-bit Trie 区间DP入门
  7. 微信小程序 JS动态修改样式
  8. Time Complexity of Loop with Powers
  9. 进阶-Redis 知识梳理
  10. IO复用(较详细)
  11. AL32UTF8 and UTF8 and ZHS16GBK
  12. poj 2763(RMQ+BIT\树链剖分)
  13. Qt简单项目--加法计算器(详细代码注释)
  14. 列表(list)的增删改查
  15. #个人博客作业Week1——浏览教材后提出的5个问题
  16. Java 在匿名内部函数中为外部函数变量赋值的解决方案
  17. C# Serializable对象序列化的作用
  18. SQL Server Profiler查询跟踪的简单使用
  19. BZOJ4017 小Q的无敌异或(位运算)
  20. isinstance 和 type 的区别

热门文章

  1. dedecms后台左侧菜单500错误怎么处理
  2. 启动Jmeter4.0 后弹出命令窗口提示信息是什么意思?
  3. 在IIS6中FLV不能播放
  4. 虚函数后面的const=0
  5. sap component 中各个组件的关系
  6. 158A
  7. iot-dm异常日志
  8. Python Singleton模式
  9. 收藏住:金融&amp;电商类原型模板重磅来袭,免费使用!
  10. 201803020001-多重MACD图.png