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. Linux下的进程环境

    僵尸进程.孤儿进程.守护进程.进程组.会话.前台进程组.后台进程组 1,僵尸进程 子进程结束,父进程没有明确的答复操作系统内核:已收到子进程结束的消息.此时操作系统内核会一直保存该子进程的部分PCB信 ...

  2. POJ 3744

    矩阵快速乘求概率,不难.但有注意的一点是,一定要注意地雷连着的情况,一旦出现两个雷相邻,就必定为0了. #include <iostream> #include <algorithm ...

  3. struts2请求过程源代码分析

    struts2请求过程源代码分析 Struts2是Struts社区和WebWork社区的共同成果.我们甚至能够说,Struts2是WebWork的升级版.他採用的正是WebWork的核心,所以.Str ...

  4. moveToThread的根本目的还是为了处理QObject的事件循环(如果为空指针的话,当前对象的所有的事件都不处理了),看官方说明就知道了

    Changes the thread affinity for this object and its children. The object cannot be moved if it has a ...

  5. poj_1952最大下降子序列,统计个数

    其实不算难的一道题,但憋了我好久,嗯,很爽. #include<iostream> #include<cstdio> #include<string.h> #inc ...

  6. .net core 实现npoi导出

    Nuget 安装 NPOI 2.4.1 工作时间写着测试玩玩 public void ExportDataToExcel() { var workbook = new HSSFWorkbook(); ...

  7. Codeforces 988F. Rain and Umbrellas

    解题思路:动态规划 遍历点i,如果从前一个点i-1走到这个点i不需要伞,则疲劳值不变dp[i] = dp[i-1]. 如果前一个点i-1走到这一个点i需要伞,则从前面找一把伞. 即遍历前面的每个点j, ...

  8. C# AssemblyResolve事件可能不触发

    C# AssemblyResolve事件需要引用的dll的“复制本地”属性设置为False,如果为True,可能不会触发这个事件的处理函数. 我想设计一个自动加载分架构的C++/CLI的dll,用到了 ...

  9. .map(function(item)...)这个是按hashcode自动遍历的,怎么才能按照我想要的顺序遍历呢?

    上图是我前端的遍历代码.我的item上有一个name的字段,分别是营业执照,税务登记证和经营许可证,我怎么设置才能让函数每次遍历的时候按照这个顺序遍历,而不是item自带的顺序呢? .map(func ...

  10. hiho150周 - 动态规划*

    题目链接 一个n*m的迷宫由‘.’和'b'组成,从(1,1)走到(n,m),只能向右或者向下走,但遇到‘b’时才能改变方向,开始时方向向右. 问到达(n,m)至少改变几个位置上的值 /******** ...