molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:6:24: error: 'n' was not declared in this scope
6 | for(int i = 0; i < n; i++){
| ^
molecules.cpp:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(v.begin(), v.end());
| ^~~~
| short
molecules.cpp:13:21: error: expected ';' before '<' token
13 | for(int i = 0, i < n; i++){
| ^~
| ;
molecules.cpp:13:22: error: expected primary-expression before '<' token
13 | for(int i = 0, i < n; i++){
| ^
molecules.cpp:20:22: error: no match for 'operator+' (operand types are 'long long int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'})
20 | if(db < n && sum + v[db + 1] <= u){
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from molecules.h:3,
from molecules.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:508:5: note: candidate: 'template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)'
508 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:508:5: note: template argument deduction/substitution failed:
molecules.cpp:20:32: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
20 | if(db < n && sum + v[db + 1] <= u){
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from molecules.h:3,
from molecules.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1540:5: note: candidate: 'template<class _Iterator> std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)'
1540 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1540:5: note: template argument deduction/substitution failed:
molecules.cpp:20:32: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>'
20 | if(db < n && sum + v[db + 1] <= u){
| ^
molecules.cpp:30:43: error: no matching function for call to 'min(long long int, int&)'
30 | for(int i = 0; i < min((n - 1) / 2, db); i++){
| ^
In file included from /usr/include/c++/10/vector:60,
from molecules.h:3,
from molecules.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
molecules.cpp:30:43: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
30 | for(int i = 0; i < min((n - 1) / 2, db); i++){
| ^
In file included from /usr/include/c++/10/vector:60,
from molecules.h:3,
from molecules.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
molecules.cpp:30:43: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
30 | for(int i = 0; i < min((n - 1) / 2, db); i++){
| ^