Main.cpp:3:15: warning: extra tokens at end of #include directive
3 | #include <map>;
| ^
Main.cpp: In function 'int dfs(std::vector<int>&, int, int)':
Main.cpp:14:15: error: 'INT_MAX' was not declared in this scope
14 | int cnt = INT_MAX;
| ^~~~~~~
Main.cpp:4:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
3 | #include <map>;
+++ |+#include <climits>
4 | using namespace std;
Main.cpp:21:26: error: no matching function for call to 'lower_bound(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::greater<int>)'
21 | auto it = lower_bound(state.begin(), state.end(), v[idx], greater<int>());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/string:51,
from /usr/include/c++/13/bits/locale_classes.h:40,
from /usr/include/c++/13/bits/ios_base.h:41,
from /usr/include/c++/13/ios:44,
from /usr/include/c++/13/ostream:40,
from /usr/include/c++/13/iostream:41,
from Main.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
1498 | lower_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:1498:5: note: template argument deduction/substitution failed:
Main.cpp:21:26: note: candidate expects 3 arguments, 4 provided
21 | auto it = lower_bound(state.begin(), state.end(), v[idx], greater<int>());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~