From 8382316a6a1d07171dfc5b89b669256c7d5f8657 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Wed, 13 Dec 2023 01:52:36 +0600 Subject: [PATCH] added 1364A --- 1364A XXXXX/1364A.cpp | 89 +++++++++++++++++++++++++++++++++++++++++++ Readme.md | 1 + 2 files changed, 90 insertions(+) create mode 100644 1364A XXXXX/1364A.cpp diff --git a/1364A XXXXX/1364A.cpp b/1364A XXXXX/1364A.cpp new file mode 100644 index 0000000..4b6b0ca --- /dev/null +++ b/1364A XXXXX/1364A.cpp @@ -0,0 +1,89 @@ +#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(map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int n,x,sum=0; + cin>>n>>x; + setst; + for(int i=0; i>k; + if(k%x) + { + st.insert(i); + st.insert(n-i-1); + } + sum+=k; + } + if(sum%x) + cout<> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 01b96ca..1efb10f 100644 --- a/Readme.md +++ b/Readme.md @@ -89,6 +89,7 @@ Feel free to check these codes out. | 1343B | Balanced Array | [Question](https://codeforces.com/contest/1343/problem/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1343B%20Balanced%20Array/1343B.cpp) | 1367B | Even Array | [Question](https://codeforces.com/problemset/problem/1367/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1367B%20%20Even%20Array/1367B.cpp) | 1360B | Honest Coach | [Question](https://codeforces.com/contest/1360/problem/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1360B%20Honest%20Coach/1360B.cpp) +| 1364A | XXXXX | [Question](https://codeforces.com/problemset/problem/1364/A) | [Solution] | 1389A | LCM Problem | [Question](https://codeforces.com/problemset/problem/1389/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1389A%20LCM%20Problem/1389A.cpp) | 1399A | Remove Smallest | [Question](https://codeforces.com/problemset/problem/1399/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1399A%20Remove%20Smallest/1399A.cpp) | 1426A | Floor Number | [Question](https://codeforces.com/contest/1426/problem/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/blob/master/1426A%20Floor%20Number/1426A.cpp)