molecules.cpp:10:15: error: 'pii' was not declared in this scope
int n;vector< pii > vals;
^~~
molecules.cpp:10:19: error: template argument 1 is invalid
int n;vector< pii > vals;
^
molecules.cpp:10:19: error: template argument 2 is invalid
molecules.cpp:11:9: error: 'pii' was not declared in this scope
bool sf(pii a, pii b);
^~~
molecules.cpp:11:16: error: 'pii' was not declared in this scope
bool sf(pii a, pii b);
^~~
molecules.cpp:11:21: error: expression list treated as compound expression in initializer [-fpermissive]
bool sf(pii a, pii b);
^
molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:16:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<w.size();i++)
~^~~~~~~~~
molecules.cpp:18:8: error: request for member 'push_back' in 'vals', which is of non-class type 'int'
vals.push_back(mp(w[i], i));
^~~~~~~~~
molecules.cpp:18:18: error: 'mp' was not declared in this scope
vals.push_back(mp(w[i], i));
^~
molecules.cpp:20:12: error: request for member 'begin' in 'vals', which is of non-class type 'int'
sort(vals.begin(), vals.end(), sf);
^~~~~
molecules.cpp:20:26: error: request for member 'end' in 'vals', which is of non-class type 'int'
sort(vals.begin(), vals.end(), sf);
^~~
molecules.cpp:21:16: error: request for member 'back' in 'vals', which is of non-class type 'int'
int mval=vals.back().f;
^~~~
molecules.cpp:22:14: error: 'begin' was not declared in this scope
for(auto &i:vals) i.f-=mval;
^~~~
molecules.cpp:22:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95:0,
from molecules.cpp:5:
/usr/include/c++/7/valarray:1211:5: note: 'std::begin'
begin(const valarray<_Tp>& __va)
^~~~~
/usr/include/c++/7/valarray:1211:5: note: 'std::begin'
molecules.cpp:22:14: error: 'end' was not declared in this scope
for(auto &i:vals) i.f-=mval;
^~~~
molecules.cpp:22:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95:0,
from molecules.cpp:5:
/usr/include/c++/7/valarray:1231:5: note: 'std::end'
end(const valarray<_Tp>& __va)
^~~
/usr/include/c++/7/valarray:1231:5: note: 'std::end'
molecules.cpp:27:16: error: invalid types 'int[int]' for array subscript
sum+=vals[i-1].f;
^
molecules.cpp:30:28: error: invalid types 'int[int]' for array subscript
if(i*mval + sum - vals[0].f<=u)
^
molecules.cpp:32:46: error: invalid types 'int[int]' for array subscript
for(int j=1;j<i;j++) ans.push_back(vals[j].s);
^
molecules.cpp:33:24: error: request for member 'back' in 'vals', which is of non-class type 'int'
ans.push_back(vals.back().s);break;
^~~~
molecules.cpp:38:45: error: invalid types 'int[int]' for array subscript
for(int j=0;j<i;j++) ans.push_back(vals[j].s);break;
^
molecules.cpp:38:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int j=0;j<i;j++) ans.push_back(vals[j].s);break;
^~~
molecules.cpp:38:50: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(int j=0;j<i;j++) ans.push_back(vals[j].s);break;
^~~~~
molecules.cpp: At global scope:
molecules.cpp:43:9: error: redefinition of 'bool sf'
bool sf(pii a, pii b)
^~~
molecules.cpp:11:6: note: 'bool sf' previously defined here
bool sf(pii a, pii b);
^~
molecules.cpp:43:9: error: 'pii' was not declared in this scope
bool sf(pii a, pii b)
^~~
molecules.cpp:43:16: error: 'pii' was not declared in this scope
bool sf(pii a, pii b)
^~~