island.cpp:9:39: error: 'int index [200000]' redeclared as different kind of entity
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^
In file included from /usr/include/string.h:432,
from /usr/include/c++/10/cstring:42,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:48,
from island.cpp:1:
/usr/include/strings.h:61:1: note: previous declaration 'const char* index(const char*, int)'
61 | index (const char *__s, int __c) __THROW
| ^~~~~
island.cpp: In function 'void unite(int, int, int)':
island.cpp:30:25: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
30 | if (neighbours[index[x]].size()<neighbours[index[y]].size())
| ^
island.cpp:30:53: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
30 | if (neighbours[index[x]].size()<neighbours[index[y]].size())
| ^
island.cpp:32:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
32 | for (auto t : neighbours[index[y]])
| ^
island.cpp:34:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
34 | neighbours[index[x]].insert(t);
| ^
island.cpp:35:21: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
35 | neighbours[index[y]].clear();
| ^
island.cpp:36:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
36 | index[y]=index[x];
| ^
island.cpp:36:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
36 | index[y]=index[x];
| ^
island.cpp:37:9: error: reference to 'size' is ambiguous
37 | if (size[x]<size[y])
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp:37:17: error: reference to 'size' is ambiguous
37 | if (size[x]<size[y])
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp:39:5: error: reference to 'size' is ambiguous
39 | size[x]=size[x]+size[y];
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp:39:13: error: reference to 'size' is ambiguous
39 | size[x]=size[x]+size[y];
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp:39:21: error: reference to 'size' is ambiguous
39 | size[x]=size[x]+size[y];
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp: In function 'int main()':
island.cpp:68:9: error: reference to 'size' is ambiguous
68 | size[i]=1;
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from island.cpp:1:
/usr/include/c++/10/bits/range_access.h:254:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
254 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:245:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
245 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
island.cpp:9:17: note: 'int size [200000]'
9 | int link[MAXN], size[MAXN], index[MAXN];
| ^~~~
island.cpp:70:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
70 | index[i]=i;
| ^
island.cpp:93:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
93 | while (!neighbours[index[leader]].empty() && (*neighbours[index[leader]].begin()).first<=a[x])
| ^
island.cpp:93:76: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
93 | while (!neighbours[index[leader]].empty() && (*neighbours[index[leader]].begin()).first<=a[x])
| ^
island.cpp:94:33: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
94 | neighbours[index[leader]].erase(neighbours[index[leader]].begin());
| ^
island.cpp:94:65: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
94 | neighbours[index[leader]].erase(neighbours[index[leader]].begin());
| ^
island.cpp:95:33: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
95 | if (neighbours[index[leader]].empty())
| ^
island.cpp:97:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
97 | auto it=neighbours[index[leader]].begin();
| ^