/in/foo.cc: In function 'void init(int)':
/in/foo.cc:10:9: error: reference to 'rank' is ambiguous
rank[i] = 0;
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc: In function 'void unite(int, int)':
/in/foo.cc:25:8: error: reference to 'rank' is ambiguous
if(rank[x] < rank[y]) {
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc:25:18: error: reference to 'rank' is ambiguous
if(rank[x] < rank[y]) {
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc:29:12: error: reference to 'rank' is ambiguous
if(rank[x] == rank[y]) rank[x]++;
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc:29:23: error: reference to 'rank' is ambiguous
if(rank[x] == rank[y]) rank[x]++;
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
/in/foo.cc:29:32: error: reference to 'rank' is ambiguous
if(rank[x] == rank[y]) rank[x]++;
^~~~
/in/foo.cc:6:5: note: candidates are: int rank [5005]
int rank[MAX_N];
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/nested_exception.h:40,
from /usr/include/c++/6/exception:173,
from /usr/include/c++/6/ios:39,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~