From ed70ad308768dca59ecc82582c4a99f632408c4e Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Fri, 15 Dec 2023 12:14:47 +0600 Subject: [PATCH] added 1869A --- 1869A Make It Zero/1869A.cpp | 99 ++++++++++++++++++++++++++++++++++++ Readme.md | 1 + 2 files changed, 100 insertions(+) create mode 100644 1869A Make It Zero/1869A.cpp diff --git a/1869A Make It Zero/1869A.cpp b/1869A Make It Zero/1869A.cpp new file mode 100644 index 0000000..6e06708 --- /dev/null +++ b/1869A Make It Zero/1869A.cpp @@ -0,0 +1,99 @@ +#include +using namespace std; + +// Short forms +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define pb push_back +#define all(x) x.begin(), x.end() +#define sz(x) (int)(x).size() + +// Outputs +#define yes cout<<"YES"< void _print(pair p); +template void _print(vector v);template void _print(set v); +template void _print(map v);template void _print(multiset v); +template void _print(pair p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";} +template void _print(vector v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(set v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(multiset v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(unordered_set v) {cerr<<"[ "; for(T i : v) {_print(i); cerr<<" ";} cerr<<"]";} +template void _print(map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(multimap v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(unordered_map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int n; + cin>>n; + vectorv(n); + int flag=1; + for(auto &x:v) + { + cin>>x; + if(x!=0) + flag=0; + } + if(flag) + { + cout<<0<> TC; + while (TC--) solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index cd9d5c2..5e4b3ce 100644 --- a/Readme.md +++ b/Readme.md @@ -163,6 +163,7 @@ Feel free to check these codes out. | 1863A | Channel | [Question](https://codeforces.com/problemset/problem/1863/A) | [Solution] | 1864A | Increasing and Decreasing | [Question](https://codeforces.com/problemset/problem/1864/A) | [Solution] | 1866A | Ambitious Kid | [Question](https://codeforces.com/problemset/problem/1866/A) | [Solution] +| 1869A | Make It Zero | [Question](https://codeforces.com/problemset/problem/1869/A) | [Solution] | 1870A | MEXanized Array | [Question](https://codeforces.com/problemset/problem/1870/A) | [Solution] | 1872A | Two Vessels | [Question](https://codeforces.com/problemset/problem/1872/A) | [Solution] | 1872B | The Corridor or There and Back Again | [Question](https://codeforces.com/problemset/problem/1872/B) | [Solution]