teams.cpp: In function 'int can(int, int*)':
teams.cpp:85:17: error: 'x' was not declared in this scope
85 | x[i]=K[i-1];
| ^
teams.cpp:86:14: error: 'x' was not declared in this scope
86 | sort(x+1,x + m + 1);
| ^
teams.cpp:113:25: error: 'e' was not declared in this scope
113 | e = st.back().S;
| ^
teams.cpp:118:28: error: 'e' was not declared in this scope
118 | int last = e,remaining;
| ^
teams.cpp:126:33: error: 'remaining' was not declared in this scope; did you mean 'remainder'?
126 | remaining = cur - ans;
| ^~~~~~~~~
| remainder
teams.cpp:132:43: error: 'remaining' was not declared in this scope; did you mean 'remainder'?
132 | if(st.back().S == last && remaining <= st.back().remain)
| ^~~~~~~~~
| remainder
teams.cpp:134:42: error: 'remaining' was not declared in this scope; did you mean 'remainder'?
134 | st.push_back({root,{last,remaining}});
| ^~~~~~~~~
| remainder
teams.cpp:134:29: error: no matching function for call to 'std::vector<std::pair<nd*, std::pair<int, int> > >::push_back(<brace-enclosed initializer list>)'
134 | st.push_back({root,{last,remaining}});
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/vector:67,
from /usr/include/c++/11/functional:62,
from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/11/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
from teams.cpp:2:
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<nd*, std::pair<int, int> >; _Alloc = std::allocator<std::pair<nd*, std::pair<int, int> > >; std::vector<_Tp, _Alloc>::value_type = std::pair<nd*, std::pair<int, int> >]'
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<nd*, std::pair<int, int> >&'}
1187 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<nd*, std::pair<int, int> >; _Alloc = std::allocator<std::pair<nd*, std::pair<int, int> > >; std::vector<_Tp, _Alloc>::value_type = std::pair<nd*, std::pair<int, int> >]'
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<nd*, std::pair<int, int> > >::value_type&&' {aka 'std::pair<nd*, std::pair<int, int> >&&'}
1203 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~