Language: C++

#include <bits/stdc++.h>

using namespace std;
using lli = int_fast64_t;
using ulli = uint_fast64_t;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl
#define debugst(x) auto xt = x;cerr << #x << " : {";for(int i=0;i<x.size();i++){ cerr << xt.top() << ", ";xt.pop();}cerr << endl
#define debugvp(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x.first << " : " << value_of_x.second << ", ";}cerr << endl

const lli MOD = 1000000007;
const lli LIMIT = 1000000000000000000 * 5;
const int tenfive = 100000;

int main() {
	int N;
	cin >> N;
	vector<int> v(N);
	for (int i = 0; i < N; i++) {
		cin >> v[i];
	}
	multiset<int, int, greater<>> se;
	for (int i = 0; i < N; i++) {
		auto it = se.upper_bound(v[i]);
		if (it != se.end()) {
		}
		if (it != se.end()) {
			se.erase(it);
		}
		se.insert(v[i]);
	}

	cout << se.size() << endl;
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/set:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_multiset.h: In instantiation of 'class std::multiset<int, int, std::greater<void> >':
a.cc:22:32:   required from here
   22 |         multiset<int, int, greater<>> se;
      |                                       ^~
/usr/include/c++/14/bits/stl_multiset.h:130:29: error: no type named 'value_type' in 'struct std::greater<void>'
  130 |         rebind<_Key>::other _Key_alloc_type;
      |                             ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:133:54: error: no type named 'value_type' in 'struct std::greater<void>'
  133 |                        key_compare, _Key_alloc_type> _Rep_type;
      |                                                      ^~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:137:58: error: no type named 'value_type' in 'struct std::greater<void>'
  137 |       typedef __gnu_cxx::__alloc_traits<_Key_alloc_type> _Alloc_traits;
      |                                                          ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:738:49: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  738 |         count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      |                                                 ^~~~
/usr/include/c++/14/bits/stl_multiset.h:823:30: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  823 |         -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
      |                              ^~~~
/usr/include/c++/14/bits/stl_multiset.h:829:30: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  829 |         -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
      |                              ^~~~
/usr/include/c++/14/bits/stl_multiset.h:853:30: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  853 |         -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
      |                              ^~~~
/usr/include/c++/14/bits/stl_multiset.h:859:30: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  859 |         -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
      |                              ^~~~
/usr/include/c++/14/bits/stl_multiset.h:881:7: error: no type named 'value_type' in 'struct std::greater<void>'
  881 |       equal_range(const key_type& __x)
      |       ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:885:7: error: no type named 'value_type' in 'struct std::greater<void>'
  885 |       equal_range(const key_type& __x) const
      |       ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:892:21: error: no type named 'value_type' in 'struct std::greater<void>'
  892 |         -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:892:46: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  892 |         -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
      |                                              ^~~~
/usr/include/c++/14/bits/stl_multiset.h:898:21: error: no type named 'value_type' in 'struct std::greater<void>'
  898 |         -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:898:46: error: using invalid field 'std::multiset<_Key, _Compare, _Alloc>::_M_t'
  898 |         -> decltype(pair<iterator, iterator>(_M_t._M_equal_range_tr(__x)))
      |                                              ^~~~
a.cc: In function 'int main()':
a.cc:24:30: error: 'class std::multiset<int, int, std::greater<void> >' has no member named 'upper_bound'
   24 |                 auto it = se.upper_bound(v[i]);
      |                              ^~~~~~~~~~~
a.cc:25:30: error: 'class std::multiset<int, int, std::greater<void> >' has no member named 'end'
   25 |                 if (it != se.end()) {
      |                              ^~~
a.cc:27:30: error: 'class std::multiset<int, int, std::greater<void> >' has no member named 'end'
   27 |                 if (it != se.end()) {
      |                              ^~~
a.cc:28:28: error: 'class std::multiset<int, int, std::greater<void> >' has no member named 'erase'
   28 |                         se.erase(it);
      |                            ^~~~~
a.cc:30:26: error: no matching function for call to 'std::multiset<int, int, std::greater<void> >::insert(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   30 |                 se.insert(v[i]);
      |                 ~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_multiset.h:553:9: note: candidate: 'template<class _InputIterator> void std::multiset<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = int; _Compare = int; _Alloc = std::greater<void>]'
  553 |         insert(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/14/bits/stl_multiset.h:553:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_multiset.h:565:7: note: candidate: 'void std::multiset<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = int; _Compare = int; _Alloc = std::greater<void>]'
  565 |       insert(initializer_list<value_type> __l)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_multiset.h:565:43: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::initializer_list<int>'
  565 |       insert(initializer_list<value_type> __l)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:33:20: error: 'class std::multiset<int, int, std::greater<void> >' has no member named 'size'
   33 |         cout << se.size() << endl;
      |                    ^~~~