aboutsummaryrefslogtreecommitdiff
path: root/codeforces/YoungPhysicist/YoungPhysicist.cpp
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-07-24 13:11:33 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-07-24 13:11:33 +0300
commit6b548332bfc6469756526002971c422f43f86d0a (patch)
tree261fde23f07c3e20cea375030f0c52863b59228c /codeforces/YoungPhysicist/YoungPhysicist.cpp
parentcff8cae22ee9c25d193ff976143813f93e658e55 (diff)
downloadcompetitive-programming-6b548332bfc6469756526002971c422f43f86d0a.tar.xz
competitive-programming-6b548332bfc6469756526002971c422f43f86d0a.zip
Removed some empty *.cpp files and Solved some new problems
Diffstat (limited to 'codeforces/YoungPhysicist/YoungPhysicist.cpp')
-rwxr-xr-xcodeforces/YoungPhysicist/YoungPhysicist.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/codeforces/YoungPhysicist/YoungPhysicist.cpp b/codeforces/YoungPhysicist/YoungPhysicist.cpp
index b126bd1..dc5056b 100755
--- a/codeforces/YoungPhysicist/YoungPhysicist.cpp
+++ b/codeforces/YoungPhysicist/YoungPhysicist.cpp
@@ -1,22 +1,21 @@
-#include<bits/stdc++.h>
+#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<vector<int>> v(n);
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < 3; j++) {
+ for (int i = 0; i < n; i++) {
+ for (int j = 0; j < 3; j++) {
int x;
cin >> x;
v[i].push_back(x);
}
}
int x = 0, y = 0, z = 0;
- for(int i = 0; i < n; i++) {
- x+=v[i][0];
- y+=v[i][1];
- z+=v[i][2];
+ for (int i = 0; i < n; i++) {
+ x += v[i][0];
+ y += v[i][1];
+ z += v[i][2];
}
cout << ((x == 0 && y == 0 && z == 0) ? "YES" : "NO") << endl;
-
}