Ahmed_Negm

Untitled

Apr 22nd, 2022
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<iomanip>
  4. #include<algorithm>
  5. #include<cstdlib>
  6. #include<cstring>
  7. #include<vector>
  8. #include<utility>
  9.  
  10. #define ll long long
  11. #define nl '\n'
  12. #define sz(x) int(x.size())
  13. #define all(x) x.begin(),x.end()
  14. #define rall(s)  s.rbegin(), s.rend()
  15. #define ceill(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
  16. using namespace std;
  17.  
  18. void Fast_IO(){
  19.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  20.     #ifndef ONLINE_JUDGE
  21.         freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  22.     #endif
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29. void solve(){
  30.   int n; cin>>n;
  31.   int x_value=0,y_value=0,z_value=0;
  32.   while(n--){
  33.       int x,y,z; cin>>x>>y>>z;
  34.       x_value+=x,y_value+=y,z_value+=z;
  35.   }
  36. if(x_value+y_value+z_value == 0) cout<<"YES";
  37. else cout<<"NO";  
  38.  
  39.  
  40.  
  41.  
  42. }
  43.  
  44. int main(){
  45.     Fast_IO();
  46. int t =1;
  47. //cin>>t;
  48. while(t--){
  49. solve();
  50. }
  51. return 0;
  52. }  
Advertisement
Add Comment
Please, Sign In to add comment