Accepted solution

69A - Young Physicist.

Open original problem
Source code

#include <iostream>

#include<vector>

#include<string>

#include<math.h>

#include<set>

#include<map>

#include<algorithm>

/***** S. M. Sabiul Hajjaj Sabit *****/

using namespace std;

template <typename T>long long int power(T a, T b)

{

    long long int pow=1;

    for(int i=0; i<b; i++)

    {

        pow *= a;

    }

    return pow;

}

///*********Write Code From Here*********///

int main()

{

    int n;

    int x=0,y=0,z=0;

    cin>>n;

    for(int i=0; i<n; i++)

    {

        int a,b,c;

        cin>>a>>b>>c;

        x+=a;

        y+=b;

        z+=c;

    }

    if(x==0 && y==0 && z==0)

    {

        cout<<"YES"<<endl;

    }

    else cout<<"NO"<<endl;

}
Join the discussion

Add your comment