http://codeforces.com/contest/69

A

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define pb push_back
 7 #define eb emplace_back
 8 #define maxn 1000006
 9 #define rep(k,i,j) for(int k=i;k<j;k++)
10 typedef long long ll;
11 typedef unsigned long long ull;
12 
13 int n;
14 struct sair{
15     int x,y,z;
16 }a[105];
17 
18 int main(){
19     #ifndef ONLINE_JUDGE
20      //   freopen("input.txt","r",stdin);
21     #endif
22     std::ios::sync_with_stdio(false);
23     cin>>n;
24     for(int i=1;i<=n;i++){
25         cin>>a[i].x>>a[i].y>>a[i].z;
26     }
27     int aa=0,bb=0,cc=0;
28     for(int i=1;i<=n;i++){
29         aa+=a[i].x;
30         bb+=a[i].y;
31         cc+=a[i].z;
32     }
33     if(aa||bb||cc) cout<<"NO"<<endl;
34     else cout<<"YES"<<endl;
35 }
View Code

相关文章: