molecules.cpp:3:44: error: 'vector' has not been declared
3 | std::vector<int> find_subset(int l, int u, vector<int> w){
| ^~~~~~
molecules.cpp:3:50: error: expected ',' or '...' before '<' token
3 | std::vector<int> find_subset(int l, int u, vector<int> w){
| ^
molecules.cpp: In function 'std::vector<int> find_subset(int, int, int)':
molecules.cpp:4:13: error: 'w' was not declared in this scope
4 | int n = w.size();
| ^
molecules.cpp:7:17: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
7 | std::vector<pair<int, int>> val;
| ^~~~
| std::pair
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
from /usr/include/c++/13/vector:62,
from molecules.h:3,
from molecules.cpp:1:
/usr/include/c++/13/bits/stl_pair.h:187:12: note: 'std::pair' declared here
187 | struct pair
| ^~~~
molecules.cpp:7:30: error: template argument 1 is invalid
7 | std::vector<pair<int, int>> val;
| ^~
molecules.cpp:7:30: error: template argument 2 is invalid
molecules.cpp:8:9: error: request for member 'push_back' in 'val', which is of non-class type 'int'
8 | val.push_back({-1e9, -1e9});
| ^~~~~~~~~
molecules.cpp:11:13: error: request for member 'push_back' in 'val', which is of non-class type 'int'
11 | val.push_back({w[i], i});
| ^~~~~~~~~
molecules.cpp:14:14: error: request for member 'begin' in 'val', which is of non-class type 'int'
14 | sort(val.begin(), val.end());
| ^~~~~
molecules.cpp:14:27: error: request for member 'end' in 'val', which is of non-class type 'int'
14 | sort(val.begin(), val.end());
| ^~~
molecules.cpp:14:5: error: 'sort' was not declared in this scope
14 | sort(val.begin(), val.end());
| ^~~~
molecules.cpp:14:5: note: suggested alternatives:
In file included from /usr/include/c++/13/algorithm:73,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
from molecules.cpp:2:
/usr/include/c++/13/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
In file included from /usr/include/c++/13/algorithm:63:
/usr/include/c++/13/bits/ranges_algo.h:1801:30: note: 'std::ranges::sort'
1801 | inline constexpr __sort_fn sort{};
| ^~~~
molecules.cpp:15:12: error: invalid types 'int[int]' for array subscript
15 | if (val[1].first > u) return {};
| ^
molecules.cpp:17:60: error: invalid types 'int[int]' for array subscript
17 | for (int i = 1; i <= n; i ++) sum[i] = sum[i - 1] + val[i].first;
| ^
molecules.cpp:24:67: error: invalid types 'int[int]' for array subscript
24 | for (int j = n; j >= n - i + 1;j --) res.push_back(val[j].second);
| ^
molecules.cpp:28:60: error: invalid types 'int[int]' for array subscript
28 | for (int j = 1; j <= i; j ++) res.push_back(val[j].second);
| ^
molecules.cpp:35:25: error: invalid types 'int[int]' for array subscript
35 | dead += val[idr].first - val[idl].first;
| ^
molecules.cpp:35:42: error: invalid types 'int[int]' for array subscript
35 | dead += val[idr].first - val[idl].first;
| ^
molecules.cpp:36:22: error: invalid types 'int[int]' for array subscript
36 | swap(val[idl], val[idr]);
| ^
molecules.cpp:36:32: error: invalid types 'int[int]' for array subscript
36 | swap(val[idl], val[idr]);
| ^
molecules.cpp:36:14: error: 'swap' was not declared in this scope
36 | swap(val[idl], val[idr]);
| ^~~~
molecules.cpp:36:14: note: suggested alternatives:
In file included from /usr/include/c++/13/regex:68,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:181:
/usr/include/c++/13/bits/regex.h:2230:5: note: 'std::__cxx11::swap'
2230 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /usr/include/c++/13/bits/stl_pair.h:61:
/usr/include/c++/13/bits/move.h:189:5: note: 'std::swap'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/13/bits/move.h:189:5: note: 'std::swap'
In file included from /usr/include/c++/13/compare:37,
from /usr/include/c++/13/bits/stl_pair.h:65:
/usr/include/c++/13/concepts:243:43: note: 'std::ranges::__cust::swap'
243 | inline constexpr __cust_swap::_Swap swap{};
| ^~~~
In file included from /usr/include/c++/13/exception:164,
from /usr/include/c++/13/stdexcept:38,
from /usr/include/c++/13/system_error:43,
from /usr/include/c++/13/bits/ios_base.h:46,
from /usr/include/c++/13/streambuf:43,
from /usr/include/c++/13/bits/streambuf_iterator.h:35,
from /usr/include/c++/13/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54:
/usr/include/c++/13/bits/exception_ptr.h:230:5: note: 'std::__exception_ptr::swap'
230 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
In file included from /usr/include/c++/13/filesystem:49,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:200:
/usr/include/c++/13/bits/fs_path.h:736:15: note: 'std::filesystem::__cxx11::swap'
736 | inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
| ^~~~
/usr/include/c++/13/concepts:183:35: note: 'std::ranges::__cust_swap::swap'
183 | template<typename _Tp> void swap(_Tp&, _Tp&) = delete;
| ^~~~
molecules.cpp:39:38: error: invalid types 'int[int]' for array subscript
39 | res.push_back(val[j].second);
| ^
molecules.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~