shui

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=;
int numa[maxn],numb[maxn];
long long suma,sumb;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int etc;
int la=,lb=,last;
suma=;sumb=;
for(int i=;i<n;i++){
scanf("%d",&etc);
if(etc>=)
{
numa[la++]=etc;
suma+=etc;
}
else{
numb[lb++]=-etc;
sumb+=-etc;
}
if(i==n-){
if(etc>=) last=;
else last=;
}
}
int state=-;
for(int i=;state==-&&i<la&&i<lb;i++){
if(numa[i]>numb[i])
state=;
if(numa[i]<numb[i])
state=;
}
if(state==-){
if(la>lb) state=;
if(la<lb) state=;
}
if(suma>sumb) printf("first\n");
else if(suma<sumb) printf("second\n");
else{
if(state==) printf("first\n");
else if(state==) printf("second\n");
else{
if(last==) printf("first\n");
else printf("second\n");
}
}
}
return ;
}

codeforces@281 B的更多相关文章

  1. codeforces#281 A

    脑子有点秀逗 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm ...

  2. Codeforces Round #281 (Div. 2)

    题目链接:http://codeforces.com/contest/493 A. Vasya and Football Vasya has started watching football gam ...

  3. Codeforces Round #281 (Div. 2) 解题报告

    题目地址:http://codeforces.com/contest/493 A题 写完后就交了,然后WA了,又读了一遍题,没找出错误后就开始搞B题了,后来回头重做的时候才发现,球员被红牌罚下场后还可 ...

  4. Codeforces Round #281 (Div. 2) D(简单博弈)

    题目:http://codeforces.com/problemset/problem/493/D 题意:一个n*n的地图,有两个人在比赛,第一个人是白皇后开始在(1,1)位置,第二个人是黑皇后开始在 ...

  5. Codeforces Round #281 (Div. 2) B. Vasya and Wrestling 水题

    B. Vasya and Wrestling 题目连接: http://codeforces.com/contest/493/problem/B Description Vasya has becom ...

  6. Codeforces Round #281 (Div. 2) A. Vasya and Football 模拟

    A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has starte ...

  7. Codeforces Round #281 (Div. 2) D. Vasya and Chess 水

    D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  8. Codeforces Round #281 (Div. 2) C. Vasya and Basketball 二分

    C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  9. Codeforces Round #281 (Div. 2) D. Vasya and Chess 镜面对称 博弈论

    D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

随机推荐

  1. ASP.NET-未解决的问题

    001.((FormsIdentity)User.Identity).Ticket.UserData 用ASP.NET后台格式化成json数据后传回去的数据有&quot这样的符号 002.HT ...

  2. [Puppeteer] Get a Page's Load Time with Puppeteer (window.profermence.timing)

    In this lesson we are going to use Google's Puppeteer to gather metrics about a page's load time. We ...

  3. L2CAP数据发送和接收

    ACL 链路在 Bluetooth 中非常重要,一些重要的应用如 A2DP, 基于 RFCOMM 的应用.BNEP等都要建立 ACL 链路,发送/接收ACL 包.跟大家一起来分析 ACL 包发送/接收 ...

  4. bzoj2463: [中山市选2009]谁能赢呢?(博弈论)

    2463: [中山市选2009]谁能赢呢? 题目:传送门 题解: 水体! n为偶数的话必能被1*2的矩形覆盖,那么因为一开始在左上角,所以先手一定可以先组成一个矩形,那么先手肯定必胜! n为奇数和上面 ...

  5. MongoDB数据查询详解

    查询全部 ​ db.infos.find(); db.infos.find({"url":"www.baidu.com"}); id不要显示出来 db.info ...

  6. SVG 贝塞尔曲线控制【方便设置】:贝塞尔曲线

    http://dayu.pw/svgcontrol/

  7. 132.try throw catch介绍

    #include <iostream> using namespace std; //try尝试执行,抛出throw,throw之后语句不再执行 //catch处理throw的异常 voi ...

  8. 22.boost图模板

    //#pragma warning(disable : 4819) #include <boost/config.hpp> #include <iostream> // for ...

  9. 指向类成员函数的函数指针及#define typedef 实现类成员函数的类型转换

    #include <iostream> using namespace std; class Test { public : void print() { cout << &q ...

  10. keepalived+双主架构部署

    在高可用集群环境中,keepalived使用的是VIP,利用keepalived自带的服务监控功能和自定义脚本来实现MYSQL故障时自带切换. Keepalived基于VRRP协议,虚拟冗余路由协议, ...