Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> set;
  int a;
  for(int i = 0;i < n;i++) {
    cin >> a;
    set.insert(a);
  }
  cout << *rbegin() - *begin() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'rbegin()'
   12 |   cout << *rbegin() - *begin() << endl;
      |            ~~~~~~^~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:150:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.rbegin()) std::rbegin(_Container&)'
  150 |     rbegin(_Container& __cont) -> decltype(__cont.rbegin())
      |     ^~~~~~
/usr/include/c++/14/bits/range_access.h:150:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:161:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.rbegin()) std::rbegin(const _Container&)'
  161 |     rbegin(const _Container& __cont) -> decltype(__cont.rbegin())
      |     ^~~~~~
/usr/include/c++/14/bits/range_access.h:161:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:194:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::reverse_iterator<_Tp*> std::rbegin(_Tp (&)[_Nm])'
  194 |     rbegin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~~
/usr/include/c++/14/bits/range_access.h:194:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:216:5: note: candidate: 'template<class _Tp> constexpr std::reverse_iterator<const _Tp*> std::rbegin(initializer_list<_Tp>)'
  216 |     rbegin(initializer_list<_Tp> __il) noexcept
      |     ^~~~~~
/usr/include/c++/14/bits/range_access.h:216:5: note:   candidate expects 1 argument, 0 provided
a.cc:12:29: error: no matching function for call to 'begin()'
   12 |   cout << *rbegin() - *begin() << endl;
      |                        ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1238:5: note:   candidate expects 1 argument, 0 provided