ProgMe

Untitled

Jan 10th, 2021
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <bits/extc++.h>
  3.  
  4. #define pb_ds
  5. #define optimization
  6. //#define file
  7. #define Long
  8.  
  9. #ifdef Long
  10. #define int int64_t
  11. #endif
  12.  
  13. #define For(l, r, i) for(int i = l; i <= r; i++)
  14.  
  15. using namespace std;
  16. #ifdef pb_ds
  17. using namespace __gnu_pbds;
  18.  
  19. typedef set<int> si;
  20. typedef deque<int> di;
  21. typedef vector<int> vi;
  22. typedef map<int, int> mii;
  23. typedef pair<int, int> pii;
  24.  
  25. template<typename T>
  26. using orset = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
  27. #endif
  28.  
  29. int32_t main() {
  30. #ifdef file
  31. freopen("input.txt", "r", stdin);
  32. freopen("output.txt", "w", stdout);
  33. #endif
  34. #ifdef optimization
  35. ios::sync_with_stdio(false);
  36. cin.tie(nullptr); cout.tie(nullptr);
  37. #endif
  38. int t = 1;
  39. //cin >> t;
  40. while(t--) {
  41. int n;
  42. cin >> n;
  43. vector<pii> a(n);
  44. vector <int >b(n);
  45. For(0, n - 1, i)
  46. cin >> a[i].first, a[i].second = i;
  47. for(auto &i: b)
  48. cin >> i;
  49. sort(a.begin(), a.end());
  50. sort(b.begin(), b.end());
  51. vector<int> ans(n);
  52. for(int i = 0; i < n; i++)
  53. ans[a[i].second] = b[i];
  54. for(auto i: ans)
  55. cout << i << ' ';
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment