Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <bits/extc++.h>
- #define pb_ds
- #define optimization
- //#define file
- #define Long
- #ifdef Long
- #define int int64_t
- #endif
- #define For(l, r, i) for(int i = l; i <= r; i++)
- using namespace std;
- #ifdef pb_ds
- using namespace __gnu_pbds;
- typedef set<int> si;
- typedef deque<int> di;
- typedef vector<int> vi;
- typedef map<int, int> mii;
- typedef pair<int, int> pii;
- template<typename T>
- using orset = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
- #endif
- int32_t main() {
- #ifdef file
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- #ifdef optimization
- ios::sync_with_stdio(false);
- cin.tie(nullptr); cout.tie(nullptr);
- #endif
- int t = 1;
- //cin >> t;
- while(t--) {
- int n;
- cin >> n;
- vector<pii> a(n);
- vector <int >b(n);
- For(0, n - 1, i)
- cin >> a[i].first, a[i].second = i;
- for(auto &i: b)
- cin >> i;
- sort(a.begin(), a.end());
- sort(b.begin(), b.end());
- vector<int> ans(n);
- for(int i = 0; i < n; i++)
- ans[a[i].second] = b[i];
- for(auto i: ans)
- cout << i << ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment