#define _GLIBCXX_DEBUG 1
#define _GLIBCXX_DEBUG_PEDANTIC 1
#define _FORTIFY_SOURCE 2
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using vi = std::vector<int>;
int main() {
vi left = {1,2,3};
vi right = {3,1,2};
vi res;
std::merge(all(left), all(right), std::back_inserter(res));
}
I2RlZmluZSBfR0xJQkNYWF9ERUJVRyAxCiNkZWZpbmUgX0dMSUJDWFhfREVCVUdfUEVEQU5USUMgMQojZGVmaW5lIF9GT1JUSUZZX1NPVVJDRSAyCgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCiNkZWZpbmUgYWxsKHgpICh4KS5iZWdpbigpLCh4KS5lbmQoKQoKdXNpbmcgdmkgPSBzdGQ6OnZlY3RvcjxpbnQ+OwoKaW50IG1haW4oKSB7CiAgICB2aSBsZWZ0ID0gezEsMiwzfTsKICAgIHZpIHJpZ2h0ID0gezMsMSwyfTsKICAgIHZpIHJlczsKICAgIHN0ZDo6bWVyZ2UoYWxsKGxlZnQpLCBhbGwocmlnaHQpLCBzdGQ6OmJhY2tfaW5zZXJ0ZXIocmVzKSk7Cn0=
/usr/include/c++/8/bits/stl_algo.h:4931:
Error: elements in iterator range [__first2, __last2) are not sorted.
Objects involved in the operation:
iterator "__first2" @ 0x0x7ffe0c7f5a20 {
type = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> > > (mutable iterator);
state = dereferenceable (start-of-sequence);
references sequence with type 'std::__debug::vector<int, std::allocator<int> >' @ 0x0x7ffe0c7f5ac0
}
iterator "__last2" @ 0x0x7ffe0c7f5a50 {
type = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> > > (mutable iterator);
state = past-the-end;
references sequence with type 'std::__debug::vector<int, std::allocator<int> >' @ 0x0x7ffe0c7f5ac0
}