diff --git a/Codes/1903A Halloumi Boxes/1903A.cpp b/Codes/1903A Halloumi Boxes/1903A.cpp new file mode 100644 index 0000000..9791f98 --- /dev/null +++ b/Codes/1903A Halloumi Boxes/1903A.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,k; + cin>>n>>k; + vectorv(n); + for(auto &x:v) cin>>x; + if(is_sorted(all(v))) + yes; + else if(n>1 && k<2) + no; + else + yes; +} + +int32_t main() +{ + FAST_IO; + int TC = 1; + cin >> TC; + while (TC--) solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 7771252..c6c4589 100644 --- a/Readme.md +++ b/Readme.md @@ -200,6 +200,7 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 1900A | Cover in Water | [Question](https://codeforces.com/problemset/problem/1900/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1900A%20Cover%20in%20Water) | 1900B | Laura and Operations | [Question](https://codeforces.com/problemset/problem/1900/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1900B%20Laura%20and%20Operations) | 1901A | Line Trip | [Question](https://codeforces.com/problemset/problem/1901/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1901A%20Line%20Trip) +| 1903A | Halloumi Boxes | [Question](https://codeforces.com/problemset/problem/1903/A) | [Solution] | 1904A | Forked! | [Question](https://codeforces.com/problemset/problem/1904/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1904A%20Forked!) | 1904B | Collecting Game | [Question](https://codeforces.com/problemset/problem/1904/B) | [Solution] | 1905A | Constructive Problems | [Question](https://codeforces.com/problemset/problem/1905/A) | [Solution]