fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, x, y, z, a=0, b=0, c=0;
  7. scanf("%d", &n);
  8. while(n--) {
  9. scanf("%d%d%d", &x, &y, &z);
  10. a+=x, b+=y, c+=z;
  11. }
  12. if(a==0 && b==0 && c==0) printf("YES");
  13. else printf("NO");
  14. return 0;
  15. }
Success #stdin #stdout 0s 3344KB
stdin
3
3 -1 7
-5 2 -4
2 -1 -3
stdout
YES