parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:10:6: error: 'vector' was not declared in this scope
10 | vector<pair<int,int>> p;
| ^~~~~~
parks.cpp:10:6: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from parks.h:1,
from parks.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from parks.h:1,
from parks.cpp:1:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
parks.cpp:10:13: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
10 | 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:18: error: expected primary-expression before 'int'
10 | vector<pair<int,int>> p;
| ^~~
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:7: error: 'p' was not declared in this scope
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:11: error: 'p' was not declared in this scope
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: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++){
| ~^~~~~~~~~~~