fork download
  1. /*
  2. Task: Problem 6.10
  3. Date: Dec 25, 2020
  4. Author: aLittleLove (Minh Vu)
  5. */
  6.  
  7. #include<bits/stdc++.h>
  8.  
  9. using namespace std;
  10. const int N = 2e5 + 5;
  11.  
  12. int a[N];
  13.  
  14. int main()
  15. {
  16. ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  17. //freopen("input.txt","r",stdin);
  18. int m, n; cin >> m;
  19. for (int i=0; i<m; i++) cin >> a[i];
  20. cin >> n;
  21. for (int i=m; i<m+n; i++) cin >> a[i];
  22. sort(a, a+m+n);
  23. for (int i=0; i<m+n; i++) cout << a[i] << " ";
  24. return 0;
  25. }
Success #stdin #stdout 0s 4716KB
stdin
5
2 5 6 8 20
4
1 7 10 11
stdout
1 2 5 6 7 8 10 11 20