rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:83:40: error: 'j' was not declared in this scope
83 | V.pb({dist[v[i].ff][v[i].ss],i,j});
| ^
rail.cpp:83:13: error: no matching function for call to 'std::vector<std::array<int, 3> >::push_back(<brace-enclosed initializer list>)'
83 | V.pb({dist[v[i].ff][v[i].ss],i,j});
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 rail.cpp:1:
/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::array<int, 3>; _Alloc = std::allocator<std::array<int, 3> >; std::vector<_Tp, _Alloc>::value_type = std::array<int, 3>]'
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::array<int, 3>&'}
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::array<int, 3>; _Alloc = std::allocator<std::array<int, 3> >; std::vector<_Tp, _Alloc>::value_type = std::array<int, 3>]'
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::array<int, 3> >::value_type&&' {aka 'std::array<int, 3>&&'}
1203 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
rail.cpp:87:16: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
87 | int x=p[1],y=p[2];
| ^
rail.cpp:89:23: error: 'y' was not declared in this scope
89 | stype[y]=3-stype[x];
| ^
rail.cpp:98:17: error: 'y' was not declared in this scope
98 | if(used[y]){
| ^
rail.cpp:109:32: error: 'y' was not declared in this scope
109 | if(dist[x][D]>dist[y][D]){
| ^
rail.cpp:113:22: error: 'y' was not declared in this scope
113 | location[y]=location[x]+dist[x][y];
| ^
rail.cpp:118:32: error: 'y' was not declared in this scope
118 | if(dist[x][0]>dist[y][0]){
| ^
rail.cpp:122:22: error: 'y' was not declared in this scope
122 | location[y]=location[x]-dist[x][y];
| ^