Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<int> a, b;
- int n, x, l, bo;
- string s, t;
- ll s1, s2;
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("input.txt","rt",stdin);
- freopen("output.txt","wt",stdout);
- #endif
- cin>>n;
- s1=s2=0;
- for (int i=0; i<n; i++) {
- scanf("%d", &x);
- if (x>0) a.pb(x), s1+=x, l=1; else
- b.pb(-x), s2+=-x, l=2;
- }
- bo=0;
- for (int i=0; i<min(a.sz, b.sz); i++) {
- if (a[i]>b[i]) bo=1; else
- if (a[i]<b[i]) bo=2;
- if (bo) break;
- }
- if (!bo) {
- if (a.sz>b.sz) bo=1; else
- if (a.sz<b.sz) bo=2;
- }
- s="first"; t="second";
- if (s1>s2) cout<<s; else
- if (s1<s2) cout<<t; else
- if (bo==1) cout<<s; else
- if (bo==2) cout<<t; else
- if (l==1) cout<<s; else
- cout<<t;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement