Codeforces Round #281 (Div. 2) B
来源:互联网 发布:python 读取临时文件 编辑:程序博客网 时间:2024/06/06 05:36
2014/12/4
血的教训。
看来我还是没受够教训。。
看了提示一眼,想当然的想歪了。。(题目都没看多少)
其实是自己傻逼,写完多想了一点(题目不糊这么简单)然后就gg了。。
煞笔的地方在于,我都pass了。。都跪在了fst。
就像那种想考满分却以为自己有天赋平时不学的nc。。。
就差了那么一点,就差了细节两个字,我绝对能从彩笔进化为老鸟。
铭记啊,校赛,市赛,省赛,西安的教训,还不够吗???
#include<stdio.h>#include<string.h>using namespace std;int a1[200005],a2[200005];int main(){ int n ; while(~scanf("%d",&n)) { int x; int cnt1=0,cnt2=0; __int64 sum1 = 0,sum2 =0 ; memset(a1,0,sizeof(a1)); memset(a2,0,sizeof(a2)); for(int i =0 ;i < n; i++) { scanf("%d",&x); if(x>0) { a1[cnt1++] = x; sum1+=x; } else a2[cnt2++] = -x, sum2+=-x; } if(sum1 < sum2) { printf("second\n"); } else if(sum1 > sum2) { printf("first\n"); } else { if(cnt1 == cnt2) { int temp = 0; for(int i= 0 ;i < cnt1; i++) { if(a1[i] > a2[i]) { temp =1 ; break; } if(a2[i] > a1[i]) { temp = -1; break; } } if(temp==1) { printf("first\n"); } else if(temp==-1) { printf("second\n"); } else { if(x > 0) { printf("first\n"); } else printf("second\n"); } } else { if(cnt1 < cnt2) { int temp = 0; for(int i = 0;i < cnt1; i++) { if(a2[i] < a1[i]) { temp = 1; break; } else if(a2[i]>a1[i]) { break; } } if(temp) { printf("first\n"); } else printf("second\n"); } else { int temp = 0; for(int i = 0;i < cnt2; i++) { if(a1[i] < a2[i]) { temp = 1; break; } else if(a1[i] > a2[i]) { break; } } if(temp) { printf("second\n"); } else printf("first\n"); } } } } return 0;}
0 0
- Codeforces Round #281 (Div. 2) B
- Codeforces Round #281 (Div. 2) A B
- Codeforces Round #281 (Div. 2) - B
- Codeforces Round #281 (Div. 2) B
- Codeforces Round #281 (Div. 2) A,B,C,D
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #134 (Div. 2)B. Airport
- Codeforces Round #170 (Div. 2) problem B
- Codeforces Round #173 (Div. 2) Problem B
- Codeforces Round #181 (Div. 2) B. Coach
- Codeforces Round #185 (Div. 2)--A,B
- Codeforces Round #171 (Div. 2) B
- Codeforces Round #169 (Div. 2) B题
- Codeforces Round #188 (Div. 2) B题
- Codeforces Round #192 (Div. 2) B
- Codeforces Round #203 (Div. 2) B. Resort
- Codeforces Round #206 (Div. 2) - b
- Codeforces Round #202 (Div. 2)B-贪心
- oracle数据库(表空间、数据段、分区、数据块)
- oracle数据库表空间(段、区、块)讲解和表空间扩展
- FreeBSD 10.1
- Codeforces Round #281 (Div. 2) C
- hdoj2008 ac
- Codeforces Round #281 (Div. 2) B
- Android SDK Manager更新失败解决方案
- 更改亚马逊 EC2 命令行提示符
- JDK9 的image模块化上线
- cocos2dx 3.0 实现 生成随机数
- 安装win8后找不到Ubuntu启动项的解决方法
- linux,top,cup,ps
- java keytool证书工具使用小结
- What Recruiters Wish You Knew About Career Fairs