molecules.cpp:2:9: warning: #pragma once in main file
2 | #pragma once
| ^~~~
molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:14: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
8 | std::vector<pair<int,int>> curr;
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from molecules.cpp:4:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
molecules.cpp:8:26: error: template argument 1 is invalid
8 | std::vector<pair<int,int>> curr;
| ^~
molecules.cpp:8:26: error: template argument 2 is invalid
molecules.cpp:10:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
10 | for(int i=0; i<w.size(); i++)
| ~^~~~~~~~~
molecules.cpp:12:8: error: request for member 'push_back' in 'curr', which is of non-class type 'int'
12 | curr.push_back({w[i],i});
| ^~~~~~~~~
molecules.cpp:15:12: error: request for member 'begin' in 'curr', which is of non-class type 'int'
15 | sort(curr.begin(),curr.end());
| ^~~~~
molecules.cpp:15:25: error: request for member 'end' in 'curr', which is of non-class type 'int'
15 | sort(curr.begin(),curr.end());
| ^~~
molecules.cpp:15:2: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(curr.begin(),curr.end());
| ^~~~
| short
molecules.cpp:21:16: error: request for member 'size' in 'curr', which is of non-class type 'int'
21 | for(; hi<curr.size(); hi++)
| ^~~~
molecules.cpp:23:12: error: invalid types 'int[int]' for array subscript
23 | sum+=curr[hi].first;
| ^
molecules.cpp:27:13: error: invalid types 'int[int]' for array subscript
27 | sum-=curr[low++].first;
| ^
molecules.cpp:43:21: error: invalid types 'int[int]' for array subscript
43 | res.push_back(curr[i].second);
| ^