diff --git a/G_1_Dances_Easy_version.cpp b/G_1_Dances_Easy_version.cpp new file mode 100644 index 0000000..fc592f7 --- /dev/null +++ b/G_1_Dances_Easy_version.cpp @@ -0,0 +1,234 @@ + +/* + +⠐⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣆⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣆⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠃⠀⠀⠀⠀⢀⠀⠀⠀⠘⣿⣿⣆⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠜⠀⣀⣠⡴⠖⠋⠀⠀⠀⠀⢿⣿⠻⡆⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⠴⠞⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⢀⡴⠞⠋⠉⣠⡆⠰⡇⠸⡇⠀⠀⠀⠀⠀⠀⠀⠸⣿⡇⠀⠀ +⠀⠀⠀⠀⠀⢠⣤⡈⠀⠀⠀⠀⢻⡇⢀⣷⣀⡇⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀⠀ +⠀⠀⠀⠀⠀⢸⡿⠗⠀⠀⠀⠀⠈⠛⠛⡉⠛⠁⠀⠀⠀⣧⠀⠀⠀⠀⢻⣿⠀⠀ +⠀⠀⠀⠴⠞⠉⠀⠀⠀⡀⠀⠀⠀⠀⢀⣿⡄⠀⠀⠀⠸⣿⣧⠀⠀⠀⢸⣿⡀⠀ +⠀⠀⠀⠀⠀⠀⠀⣠⣾⡇⠀⠀⠀⠀⠈⣿⣧⠀⠀⠀⠀⢻⣿⠷⠀⠀⠈⣿⡇⠀ +⠀⠀⠀⠀⠀⠀⢰⡿⢻⡇⠀⠀⠀⠀⠀⢿⣿⠀⠀⠀⠀⠘⣿⡆⠀⠀⠀⣿⣧⠀ +⢠⡆⠀⠀⠀⠀⣾⠃⣾⡇⠀⠀⠀⠀⠀⢸⣿⡄⠀⠀⠀⠀⢿⣿⡀⠀⠀⢸⣿⠀ +⢸⡇⠀⠀⠀⢠⡿⠀⣿⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠘⣿⣇⠀⠀⠘⣿⡄ +⢸⣧⠀⠀⠀⢸⡇⠀⣿⡀⠀⠀⠀⠀⠀⢰⣿⣿⡄⠀⠀⠀⠀⢹⡟⠀⠀⠀⣿⡇ +⠈⣿⡄⠀⢀⣿⠇⠀⣿⣧⡀⠀⠀⠀⣠⣿⠋⣿⣿⣦⣀⣀⣠⣾⡇⠀⠀⠀⢿⡇ +⠀⢻⣿⣶⣾⡿⠀⠀⠹⣿⣿⣶⣶⣿⣿⠋⠀⠈⠻⣿⣿⣿⡿⠟⠀⠀⠀⠀⢸⡇ +⠀⠀⠙⠛⠋⠀⠀⠀⠀⠈⠛⠿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀ + +*/ +/* + "BISMILLAHIR RAHMANIR RAHIM" + ("IN THE NAME OF ALLAH, THE MOST GRACIOUS AND THE MOST MERCIFUL") + CodeMonsterShu + Department of Computer Science and Engineering + Sheikh Hasina University, Netrokona, Bangladesh. +*/ + +#include +// #include +// #include +using namespace std; +// using namespace __gnu_pbds; +#define ll long long +#define vll vector +#define vpll vector> +#define pll pair +#define gcd __gcd +#define inf 1e18 +#define pb push_back +#define ff first +#define ss second +#define int long long +#define f(i, a, n) for (long long int i = a; i < n; i++) +#define g(i, a, n) for (long long int i = a; i >= n; i--) +#define w(t) \ + int t; \ + cin >> t; \ + f(case_num, 1, t + 1) +#define all(x) x.begin(), x.end() +#define no cout << "No" << endl +#define ALL(x) (x).begin(), (x).end() +#define py cout << "YES\n"; +#define pm cout << "-1\n"; +#define pz cout << "0\n"; +#define pn cout << "NO\n"; +#define cheakmate return; +// #define pbds tree, rb_tree_tag, tree_order_statistics_node_update> //for set +// int d = st.order_of_key(pre2[n / 2]); +// #define pbds tree, rb_tree_tag, tree_order_statistics_node_update> //for multiset + +const int N = 1e5 + 5; +#define Mod 1000000009 + 7 + +// const int N = 1e7 + 10; +// const long long int arr[N]; +// string s; +// bool sorted = is_sorted(s.begin(), s.end()); +// if (sorted) +// { +// cout << "Sorted" << endl; +// return; +// } + +// bool cheak(const vector &a) +// { +// if (is_sorted(a.begin(), a.end())) +// { + +// return true; +// } +// else +// { + +// return false; +// } +// } + +// if (is_sorted(a.begin(), a.end())) +// { +// cout << "YES" << endl; +// return; +// } + +// if (find(a1.begin(), a1.end(), a2[m - 1]) != a1.end()) +// { +// cout << "YES" << endl; +// } +// else +// { +// cout << "NO" << endl; +// } + +// binary to decimal bitset<8> binaryNumber(x) 8 bit print binarynumber + +// set count + +// character to integer +// int asciiValue = static_cast(h); + +// bool all_elements_same(const vector &arr) +// { +// if (arr.empty()) +// return true; // An empty array can be considered to have all equal elements + +// for (const int &element : arr) +// { +// if (element != arr[0]) +// { +// return false; +// } +// } +// return true; +// } +bool sieve(int n) +{ + if (n < 2) + return false; // 0 and 1 are not prime + + vector isPrime(n + 1, true); + isPrime[0] = isPrime[1] = false; + + for (int i = 2; i * i <= n; i++) + { + if (isPrime[i]) + { + for (int j = i * i; j <= n; j += i) + { + isPrime[j] = false; + } + } + } + return isPrime[n]; // Return whether `n` is prime +} + +// vector> a(n, vector(m)); + +// bool isPowerOfTwo(int x) +// { +// return (x > 0) && ((x & (x - 1)) == 0); +// } + +// int findPreviousExponent(int x) +// {a +// if (isPowerOfTwo(x)) +// { +// return static_cast(log2(x)); +// } +// int lowerExponent = static_cast(floor(log2(x))); +// return lowerExponent; +// } + +// int binaryExponenetialIterative(int a, int b) +// { +// int ans = 1; +// while (b) +// { + +// if (b & 1) +// { +// ans = (ans * 1ll * a) % Mod; +// } +// a = (a * 1ll * a) % Mod; +// b >>= 1; +// } +// return ans; +// } +void solve() +{ + + // 2d input + // vector> d(n, vector< int>(m)); + int n; + cin >> n; + vector a(n), b(n); + for (int i = 0; i < n - 1; i++) + { + cin >> a[i]; + } + for (int i = 0; i < n; i++) + { + cin >> b[i]; + } + sort(ALL(a)); + sort(ALL(b)); + + int ans = 0; + for (int i = n - 1, j = n - 1; i >= 0; i--, j--) + { + } +} +// priority_queuepq; +// priority_queue,greater>pq; +// sort(ALL(a),greater()); +// int maxi=*max_element(a.begin(),a.end()); +// int maxi = distance(a.begin(), max_element(a.begin(), a.end())); // return max index + +// sort(vec.begin(), vec.end(), [](const pair &a, const pair &b) { +// if (a.first != b.first) { +// return a.first < b.first; // Sort by first element (ascending) +//} +// return a.second > b.second; // If first elements are equal, sort by second element (descending) +// }); +signed main() +{ + + ios::sync_with_stdio(false); + cin.tie(nullptr); + cout.tie(nullptr); + + int t; + cin >> t; + while (t--) + { + solve(); + } + return 0; +} + +/*=============================================== + :::::::::::::Author :Md.Mursalin::::::::::::: + ===============================================*/