diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-10 16:05:26 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-10 16:05:26 +0200 |
| commit | 95422138588572e08a1ee78e654741874f11cfa0 (patch) | |
| tree | 1a03ad9c57788546e804724ed4507f46c385263d /codeforces/TwoGroups/main.cpp | |
| parent | 42e25addbbce62e8bb43ab587b21c5bccb495bfb (diff) | |
| download | competitive-programming-95422138588572e08a1ee78e654741874f11cfa0.tar.xz competitive-programming-95422138588572e08a1ee78e654741874f11cfa0.zip | |
Added some new problems
Diffstat (limited to 'codeforces/TwoGroups/main.cpp')
| -rw-r--r-- | codeforces/TwoGroups/main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/codeforces/TwoGroups/main.cpp b/codeforces/TwoGroups/main.cpp new file mode 100644 index 0000000..0f7a8f9 --- /dev/null +++ b/codeforces/TwoGroups/main.cpp @@ -0,0 +1,21 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + long long ans = 0; + for (int i = 0; i < n; i++) { + int x; + cin >> x; + ans += x; + } + cout << abs(ans) << '\n'; + } +} |
