codeforces@281 B
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的更多相关文章
- codeforces#281 A
脑子有点秀逗 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm ...
- Codeforces Round #281 (Div. 2)
题目链接:http://codeforces.com/contest/493 A. Vasya and Football Vasya has started watching football gam ...
- Codeforces Round #281 (Div. 2) 解题报告
题目地址:http://codeforces.com/contest/493 A题 写完后就交了,然后WA了,又读了一遍题,没找出错误后就开始搞B题了,后来回头重做的时候才发现,球员被红牌罚下场后还可 ...
- Codeforces Round #281 (Div. 2) D(简单博弈)
题目:http://codeforces.com/problemset/problem/493/D 题意:一个n*n的地图,有两个人在比赛,第一个人是白皇后开始在(1,1)位置,第二个人是黑皇后开始在 ...
- Codeforces Round #281 (Div. 2) B. Vasya and Wrestling 水题
B. Vasya and Wrestling 题目连接: http://codeforces.com/contest/493/problem/B Description Vasya has becom ...
- Codeforces Round #281 (Div. 2) A. Vasya and Football 模拟
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has starte ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- BTrace介绍和生产环境样例
BTrace latest realese: release-1.2.5.1 BTrace guide(1.2-20101020): http://kenai.com/projects/btrace/ ...
- HDU 1521
指数型生成函数.做这题时,回去看看组合数学才知道,指数生成函数求的就是多重集合的r排列数. #include <iostream> #include <cstdio> #inc ...
- jsoup抓取网页+具体解说
jsoup抓取网页+具体解说 Java 程序在解析 HTML 文档时,相信大家都接触过 htmlparser 这个开源项目.我以前在 IBM DW 上发表过两篇关于 htmlparser 的文章.各自 ...
- linux下tomcat开机启动简单配置
1.个人标记 caicongyang http://blog.csdn.net/caicongyang 2.正文 在linux文件/etc/rc.d/rc.local的末尾加入例如以下行就可以: ex ...
- 斯坦福新深度学习系统 NoScope:视频对象检测快1000倍
以作备份,来源http://jiasuhui.com/archives/178954 本文由“新智元”(微信ID:AI_era)编译,来源:dawn.cs.stanford.edu,编译:刘小芹 斯坦 ...
- BZOJ 3175 最大独立集
思路: 最大独立集嘛 用nlogn的Dinic做 //By SiriusRen #include <queue> #include <cstdio> #include < ...
- POJ 1990 MooFest【 树状数组 】
题意:给出n头牛,每头牛有一个听力v,坐标x,两头牛之间的能量为max(v1,v2)*dist(v1,v2),求总的能量值 先将每头牛按照v排序,排完顺序之后,会发现有坐标比当前的x小的,会有坐标比当 ...
- codeforces 493 C Vasya and Basketball
题意:给出三分线的值d,分别有两支队伍,如果小于等于d,得2分,如果大于d,得三分,问使得a-b最大时的a,b 一看到题目,就想当然的去二分了----啥都没分出来---55555555 后来才知道不能 ...
- Volatile variables
Volatile variables apply another type of memory constraint to individual variables. The compiler oft ...
- c++string类的简单介绍
#include "iostream" #include "string" using namespace std; /*@author:浅滩 *family: ...