diff --git a/Codes/1904B Collecting Game/1904B.cpp b/Codes/1904B Collecting Game/1904B.cpp new file mode 100644 index 0000000..232afa7 --- /dev/null +++ b/Codes/1904B Collecting Game/1904B.cpp @@ -0,0 +1,94 @@ +#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; + cin>>n; + vector > v(n); + vectorpre(n),ans(n); + for(int i=0; i>v[i].ff; + v[i].ss=i; + } + sort(all(v)); + pre[0]=v[0].ff; + for(int i=1; i=0; --i) + { + if(pre[i]> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index ae29828..331eb99 100644 --- a/Readme.md +++ b/Readme.md @@ -196,6 +196,7 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 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) | 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] | 1905B | Begginer's Zelda | [Question](https://codeforces.com/problemset/problem/1905/B) | [Solution] | 1905C | Largest Subsequence | [Question](https://codeforces.com/problemset/problem/1905/C) | [Solution]