rail.cpp:17:13: error: invalid declarator before 'lef'
17 | vector<pla> lef;
| ^~~
rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:37:15: error: 'getDistance' was not declared in this scope
37 | dis1[i] = getDistance(0, i);
| ^~~~~~~~~~~
rail.cpp:52:17: error: 'getDistance' was not declared in this scope
52 | dis2[i] = getDistance(sp, i);
| ^~~~~~~~~~~
rail.cpp:66:7: error: 'lef' was not declared in this scope
66 | lef.push_back(i, dis2[i]);
| ^~~
rail.cpp:69:20: error: no matching function for call to 'std::vector<pla>::push_back(int&, int&)'
69 | rig.push_back(i, dis1[i]);
| ~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/11/vector:67,
from rail.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 = pla; _Alloc = std::allocator<pla>; std::vector<_Tp, _Alloc>::value_type = pla]'
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate expects 1 argument, 2 provided
/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 = pla; _Alloc = std::allocator<pla>; std::vector<_Tp, _Alloc>::value_type = pla]'
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate expects 1 argument, 2 provided
rail.cpp:74:8: error: 'lef' was not declared in this scope
74 | sort(lef.begin(), lef.end(), cmp2);
| ^~~
rail.cpp:77:14: error: expected unqualified-id before 'auto'
77 | for(const &auto inf : rig){
| ^~~~
rail.cpp:77:14: error: expected ';' before 'auto'
77 | for(const &auto inf : rig){
| ^~~~
| ;
rail.cpp:77:23: error: found ':' in nested-name-specifier, expected '::'
77 | for(const &auto inf : rig){
| ^
| ::
rail.cpp:77:19: error: 'inf' has not been declared
77 | for(const &auto inf : rig){
| ^~~
rail.cpp:77:28: error: qualified-id in declaration before ')' token
77 | for(const &auto inf : rig){
| ^
rail.cpp:77:28: error: expected ';' before ')' token
77 | for(const &auto inf : rig){
| ^
| ;
rail.cpp:78:14: error: 'inf' was not declared in this scope; did you mean 'int'?
78 | int n1 = inf.x;
| ^~~
| int
rail.cpp:89:16: error: 'getDistance' was not declared in this scope
89 | int n3 = getDistance(cur, n1);
| ^~~~~~~~~~~
rail.cpp:111:14: error: expected unqualified-id before 'auto'
111 | for(const &auto inf : lef){
| ^~~~
rail.cpp:111:14: error: expected ';' before 'auto'
111 | for(const &auto inf : lef){
| ^~~~
| ;
rail.cpp:111:23: error: found ':' in nested-name-specifier, expected '::'
111 | for(const &auto inf : lef){
| ^
| ::
rail.cpp:111:19: error: 'inf' has not been declared
111 | for(const &auto inf : lef){
| ^~~
rail.cpp:111:28: error: qualified-id in declaration before ')' token
111 | for(const &auto inf : lef){
| ^
rail.cpp:111:28: error: expected ';' before ')' token
111 | for(const &auto inf : lef){
| ^
| ;
rail.cpp:112:14: error: 'inf' was not declared in this scope; did you mean 'int'?
112 | int n1 = inf.x;
| ^~~
| int
rail.cpp:123:16: error: 'getDistance' was not declared in this scope
123 | int n3 = getDistance(cur, n1);
| ^~~~~~~~~~~