Language: C++

#include "bits/stdc++.h"

using namespace std;
using ll = long long;
using ull = unsigned long long;

typedef pair<int, int>pi;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
typedef pair<P, P> PPP;

const ll MOD = 1e9 + 7;
const ll INF = 9e18;
const double DINF = 5e14;
const double eps = 1e-10;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second

int a, b, h, m;
vector<PP>v;

int main() {
	cin >> a;
	for (int i = 0;i < a;i++) {
		cin >> h >> m;
		v.eb(PP(h * 60 + m, P(h, m)));
	}
	cin >> b;
	for (int i = 0;i < b;i++) {
		cin >> h >> m;
		v.eb(PP(h * 60 + m, P(h, m)));
	}
	sort(ALL(v));
	v.erase(unique(ALL(v), v.end()));
	for (int i = 0;i < a + b;i++) {
		string p = to_string(v[i].sc.sc);
		if (v[i].sc.sc < 10)p = "0" + p;
		if (i != a + b - 1)cout << v[i].sc.fr << ':' << p << ' ';
		else cout << v[i].sc.fr << ':' << p << endl;
	}
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >; _BinaryPredicate = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:40:16:   required from here
   40 |         v.erase(unique(ALL(v), v.end()));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >) (std::pair<long long int, std::pair<long long int, long long int> >&, std::pair<long long int, std::pair<long long int, long long int> >&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~