题目链接: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 ;
}

Codeforces 841B - Godsend的更多相关文章

  1. codeforces Round#429 (Div2)

    2017-08-20 10:00:37 writer:pprp 用头文件#include <bits/stdc++.h>很方便 A. Generous Kefa codeforces 84 ...

  2. Codeforces Round #429 (Div. 2/Div. 1) [ A/_. Generous Kefa ] [ B/_. Godsend ] [ C/A. Leha and Function ] [ D/B. Leha and another game about graph ] [ E/C. On the Bench ] [ _/D. Destiny ]

    PROBLEM A/_ - Generous Kefa 题 OvO http://codeforces.com/contest/841/problem/A cf 841a 解 只要不存在某个字母,它的 ...

  3. 【Codeforces Round #429 (Div. 2) B】 Godsend

    [Link]:http://codeforces.com/contest/841/problem/B [Description] 两个人轮流对一个数组玩游戏,第一个人可以把连续的一段为奇数的拿走,第二 ...

  4. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  5. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  6. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  7. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  8. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  9. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

随机推荐

  1. finecms如何调用多个指定栏目的内容

    想调用finecms多个栏目的内容,用英文状态下的逗号来分开多个id实现不了(catid=1,2,3),要如何写噢?后面ytkah想想这个跟sql语法有点一样,用IN_catid = 1,2,3果然成 ...

  2. 前端框架之Vue(2)-模板语法

    Vue.js 使用了基于 HTML 的模板语法,允许开发者声明式地将 DOM 绑定至底层 Vue 实例的数据.所有 Vue.js 的模板都是合法的 HTML ,所以能被遵循规范的浏览器和 HTML 解 ...

  3. [js]js的表单验证onsubmit方法

    http://uule.iteye.com/blog/2183622 表单验证类 <form class="form" method="post" id= ...

  4. 接口,定义接口的关键字是 interface 实现接口关键字是 implements

    当抽象类中的方法都是抽象的时候,这时可以将该抽象类用另一种形式定义和表示,就是接口interface特点:对于接口中常见的成员:而且这些成员都有固定的修饰符,不写就默认存在1:全局常量 :  都是 p ...

  5. Linux下Nginx安装

    前提: 1.需要gcc环境:yum install gcc-c++ 2.需要第三方开发包: PCRE.zlib.openssl yum install -y pcre pcre-devel yum i ...

  6. zabbix 自定义监控文本内容

    需求:监控服务器硬盘使用率是否有超过80%的 需要监控的文本 root@zabbix zabbix]# cat /etc/zabbix/scripts/data/monitor_disk.txt &q ...

  7. Flask框架从入门到实战

    Flask简介: Flask是一个使用 Python 编写的轻量级 Web 应用框架,基于 WerkzeugWSGI工具箱和 Jinja2模板引擎.使用 BSD 授权. Flask也被称为 " ...

  8. python导入csv/txt文件

    1. 导入csv文件 ### python导入csv文件的三种方法 ```python #原始的方式 lines = [line.split(',') for line in open('iris.c ...

  9. iOS应用图标及尺寸

    Icon and Image Sizes Every app needs an app icon and a launch file or image. In addition, some apps ...

  10. lldb使用

    常用 si,ni ,ex, mem,di,reg,b,c,x 以下内容是lldb帮助文档中内容: apropos           -- List debugger commands related ...