islands.cpp: In function 'int dfs(int)':
islands.cpp:63:12: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::pair<int, int>')
63 | if(p[x]==u)continue;
In file included from /usr/include/c++/10/utility:70,
from /usr/include/c++/10/variant:37,
from islands.h:1,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:466:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)'
466 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_pair.h:466:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::pair<_T1, _T2>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from islands.h:1,
from islands.cpp:1:
/usr/include/c++/10/variant:1186:3: note: candidate: 'template<class ... _Types> constexpr bool std::operator==(const std::variant<_Types ...>&, const std::variant<_Types ...>&)'
1186 | _VARIANT_RELATION_FUNCTION_TEMPLATE(==, equal)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/variant:1186:3: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::variant<_Types ...>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from islands.h:1,
from islands.cpp:1:
/usr/include/c++/10/variant:1193:18: note: candidate: 'constexpr bool std::operator==(std::monostate, std::monostate)'
1193 | constexpr bool operator==(monostate, monostate) noexcept { return true; }
| ^~~~~~~~
/usr/include/c++/10/variant:1193:29: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::monostate'
1193 | constexpr bool operator==(monostate, monostate) noexcept { return true; }
| ^~~~~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:360:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)'
360 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:360:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:398:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
398 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:398:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1427:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1427 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1427:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1495:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)'
1495 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1495:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from /usr/include/c++/10/vector:64,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/allocator.h:206:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const std::allocator<_Tp1>&, const std::allocator<_T2>&)'
206 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/10/bits/allocator.h:206:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::allocator<_Tp1>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
In file included from /usr/include/c++/10/vector:67,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1892:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)'
1892 | operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1892:5: note: template argument deduction/substitution failed:
islands.cpp:63:14: note: mismatched types 'const std::vector<_Tp, _Alloc>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
63 | if(p[x]==u)continue;
| ^
islands.cpp:64:11: error: no match for 'operator[]' (operand types are 'vi' {aka 'std::vector<int>'} and 'std::pair<int, int>')
64 | if(vis[u]){
| ^
In file included from /usr/include/c++/10/vector:67,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1043:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::reference = int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1043:28: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1061:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1061:28: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
islands.cpp:65:15: error: no matching function for call to 'std::vector<int>::push_back(std::pair<int, int>&)'
65 | ind.PB(u);
| ^
In file included from /usr/include/c++/10/vector:67,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'const value_type&' {aka 'const int&'}
1187 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]'
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
1203 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
islands.cpp:66:14: error: cannot convert 'std::pair<int, int>' to 'int' in return
66 | return u;
| ^
islands.cpp:68:15: error: cannot convert 'std::pair<int, int>' to 'int'
68 | int k=dfs(u);
| ^
| |
| std::pair<int, int>
islands.cpp:60:13: note: initializing argument 1 of 'int dfs(int)'
60 | int dfs(int x){
| ~~~~^
islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:78:3: error: 'map' was not declared in this scope
78 | map<pi,int> mp,mp2;
| ^~~
islands.cpp:2:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
1 | #include "islands.h"
+++ |+#include <map>
2 |
islands.cpp:78:9: error: expected primary-expression before ',' token
78 | map<pi,int> mp,mp2;
| ^
islands.cpp:78:10: error: expected primary-expression before 'int'
78 | map<pi,int> mp,mp2;
| ^~~
islands.cpp:80:5: error: 'mp' was not declared in this scope; did you mean 'p'?
80 | mp[{U[i],V[i]}]=i;
| ^~
| p
islands.cpp:82:5: error: 'mp2' was not declared in this scope
82 | mp2[{U[i],V[i]}]=i;
| ^~~
islands.cpp:103:6: error: no match for 'operator[]' (operand types are 'vi' {aka 'std::vector<int>'} and 'std::pair<int, int>')
103 | p[u]=0;ind.PB(u.F);
| ^
In file included from /usr/include/c++/10/vector:67,
from islands.h:2,
from islands.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:1043:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::reference = int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1043:28: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
1043 | operator[](size_type __n) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_vector.h:1061:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/10/bits/stl_vector.h:1061:28: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
1061 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~^~~
islands.cpp:104:11: error: cannot convert 'std::pair<int, int>' to 'int'
104 | k=dfs(u);
| ^
| |
| std::pair<int, int>
islands.cpp:60:13: note: initializing argument 1 of 'int dfs(int)'
60 | int dfs(int x){
| ~~~~^
islands.cpp:112:10: error: 'mp' was not declared in this scope; did you mean 'p'?
112 | a.PB(mp[{ind[pos],ind[pos+1]}]);
| ^~
| p
islands.cpp:121:10: error: 'mp' was not declared in this scope; did you mean 'tmp'?
121 | b.PB(mp[{tmp[i],tmp[i+1]}]);
| ^~
| tmp
islands.cpp:125:10: error: 'mp2' was not declared in this scope
125 | c.PB(mp2[{tmp[i],tmp[i+1]}]);
| ^~~
islands.cpp:128:3: error: 'reverse' was not declared in this scope
128 | reverse(b.begin,b.end());
| ^~~~~~~