Language: C++

//競技プログラミング　テンプレ
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

const int max_v = 300;
const int INF = 1000000;



int main() {
	int a,b,n=0;
  int ans;
	string x,y;

  cin >> x >> y; 
  sort(x.begin(),x.end());
  sort(y.begin(),y.end(),greater<char*>());
  if(x < y ){ cout << "Yes" << endl; return 0;}
  else {cout << "No" << endl; return 0;}
  //else if(x ==y){ if()return 0;}
  

	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/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<char*, std::__cxx11::basic_string<char> >; _Iterator2 = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Compare = std::greater<char*>]':
/usr/include/c++/14/bits/stl_algo.h:1777:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1777 |           if (__comp(__i, __first))
      |               ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = greater<char*>]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:7:   required from here
   24 |   sort(y.begin(),y.end(),greater<char*>());
      |   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(std::greater<char*>) (char&, char&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:49:
/usr/include/c++/14/bits/stl_function.h:433:7: note: candidate: 'constexpr bool std::greater<_Tp*>::operator()(_Tp*, _Tp*) const [with _Tp = char]' (near match)
  433 |       operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_function.h:433:7: note:   conversion of argument 2 would be ill-formed:
/usr/include/c++/14/bits/stl_function.h:433:7: error: invalid conversion from 'char' to 'char*' [-fpermissive]
  433 |       operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
      |       ^~~~~~~~
      |       |
      |       char
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = char; _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Compare = std::greater<char*>]':
/usr/include/c++/14/bits/stl_algo.h:1757:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<greater<char*> >]'
 1757 |       while (__comp(__val, __next))
      |              ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1785:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1785 |             std::__unguarded_linear_insert(__i,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
 1786 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = greater<char*>]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:7:   required from here
   24 |   sort(y.begin(),y.end(),greater<char*>());
      |   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:240:30: error: no match for call to '(std::greater<char*>) (char&, char&)'
  240 |         { return bool(_M_comp(__val, *__it)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_function.h:433:7: note: candidate: 'constexpr bool std::greater<_Tp*>::operator()(_Tp*, _Tp*) const [with _Tp = char]' (near match)
  433 |       operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_function.h:433:7: note:   conversion of argument 2 would be ill-formed:
/usr/include/c++/14/bits/stl_function.h:433:7: error: invalid conversion from 'char' to 'char*' [-fpermissive]
  433 |       operator()(_Tp* __x, _Tp* __y) const _GLIBCXX_NOTHROW
      |       ^~~~~~~~
      |       |
      |       char
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Value = char; _Compare = std::greater<char*>]':
/usr/include/c++/14/bits/stl_heap.h:140:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Distance = long int; _Tp = char; _Compare = __gnu_cxx::__ops::_Iter_comp_val<greater<char*> >]'
  140 |       while (__holeIndex > __topIndex && __comp(__first + __parent, __value))
      |                                          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:247:23:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Distance = long int; _Tp = char; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
  247 |       std::__push_heap(__first, __holeIndex, __topIndex,
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  248 |                        _GLIBCXX_MOVE(__value), __cmp);
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:356:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
  356 |           std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
      |           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  357 |                              __comp);
      |                              ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1593:23:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1593 |       std::__make_heap(__first, __middle, __comp);
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25:   required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1868 |       std::__heap_select(__first, __middle, __last, __comp);
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<char*> >]'
 1884 |