parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:10:18: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
10 | std::vector<pair<int,int>> p;
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from parks.h:1,
from parks.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
parks.cpp:10:30: error: template argument 1 is invalid
10 | std::vector<pair<int,int>> p;
| ^~
parks.cpp:10:30: error: template argument 2 is invalid
parks.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
11 | for(int i=0;i<x.size();i++){
| ~^~~~~~~~~
parks.cpp:12:9: error: request for member 'push_back' in 'p', which is of non-class type 'int'
12 | p.push_back(make_pair(y[i],i));
| ^~~~~~~~~
parks.cpp:12:19: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
12 | p.push_back(make_pair(y[i],i));
| ^~~~~~~~~
| std::make_pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/vector:60,
from parks.h:1,
from parks.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:567:5: note: 'std::make_pair' declared here
567 | make_pair(_T1&& __x, _T2&& __y)
| ^~~~~~~~~
parks.cpp:14:13: error: request for member 'begin' in 'p', which is of non-class type 'int'
14 | sort(p.begin(),p.end());
| ^~~~~
parks.cpp:14:23: error: request for member 'end' in 'p', which is of non-class type 'int'
14 | sort(p.begin(),p.end());
| ^~~
parks.cpp:14:6: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
14 | sort(p.begin(),p.end());
| ^~~~
| std::sort
In file included from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from parks.cpp:2:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
parks.cpp:15:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
15 | for(int i=1;i<x.size();i++){
| ~^~~~~~~~~
parks.cpp:16:11: error: invalid types 'int[int]' for array subscript
16 | if(p[i].first%2==1 || p[i].first-y[i-1].first!=2){
| ^
parks.cpp:16:30: error: invalid types 'int[int]' for array subscript
16 | if(p[i].first%2==1 || p[i].first-y[i-1].first!=2){
| ^
parks.cpp:16:47: error: request for member 'first' in 'y.std::vector<int>::operator[](((std::vector<int>::size_type)(i - 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
16 | if(p[i].first%2==1 || p[i].first-y[i-1].first!=2){
| ^~~~~
parks.cpp:22:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
22 | for(int i=0;i<x.size()-1;i++){
| ~^~~~~~~~~~~
parks.cpp:23:21: error: invalid types 'int[int]' for array subscript
23 | u.push_back(p[i].second);
| ^
parks.cpp:24:21: error: invalid types 'int[int]' for array subscript
24 | v.push_back(p[i+1].second);
| ^
parks.cpp:26:21: error: invalid types 'int[int]' for array subscript
26 | b.push_back(p[i].first+1);
| ^