From 622c7acc7915c0769e7eeef99aba248504c62082 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Mon, 18 Dec 2023 16:23:23 +0600 Subject: [PATCH] added 1855B --- .../1855B Longest Divisors Interval/1855B.cpp | 80 +++++++++++++++++++ Readme.md | 1 + 2 files changed, 81 insertions(+) create mode 100644 Codes/1855B Longest Divisors Interval/1855B.cpp diff --git a/Codes/1855B Longest Divisors Interval/1855B.cpp b/Codes/1855B Longest Divisors Interval/1855B.cpp new file mode 100644 index 0000000..d2ad04e --- /dev/null +++ b/Codes/1855B Longest Divisors Interval/1855B.cpp @@ -0,0 +1,80 @@ +#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; + for(int i=1; i<100; i++) + { + if(n%i) + { + cout<> TC; + while (TC--) solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index c021066..7eb3ef7 100644 --- a/Readme.md +++ b/Readme.md @@ -153,6 +153,7 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 1851C | Tiles Comeback | [Question](https://codeforces.com/problemset/problem/1851/C) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1851C%20Tiles%20Comeback) | 1853A | Desorting | [Question](https://codeforces.com/contest/1853/problem/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1853A%20Desorting) | 1855A | Dalton the Teacher | [Question](https://codeforces.com/contest/1855/problem/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1855A%20Dalton%20the%20Teacher) +| 1855B | Longest Divisors Interval | [Question](https://codeforces.com/problemset/problem/1855/B) | [Solution] | 1856B | Good Arrays | [Question](https://codeforces.com/problemset/problem/1856/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1856B%20Good%20Arrays) | 1857A | Array Coloring | [Question](https://codeforces.com/problemset/problem/1857/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1857A%20%20Array%20Coloring) | 1857B | Maximum Rounding | [Question](https://codeforces.com/problemset/problem/1857/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1857B%20Maximum%20Rounding)