island.cpp:11:34: error: 'std::vector<int> select' redeclared as different kind of symbol
vector<int> adj[300000], parent, select;
^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:219:0,
from /usr/include/stdlib.h:314,
from /usr/include/c++/7/bits/std_abs.h:38,
from /usr/include/c++/7/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41,
from island.cpp:1:
/usr/include/x86_64-linux-gnu/sys/select.h:106:12: note: previous declaration 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)'
extern int select (int __nfds, fd_set *__restrict __readfds,
^~~~~~
island.cpp: In function 'int main()':
island.cpp:37:9: error: request for member 'resize' in 'select', which is of non-class type 'int(int, fd_set*, fd_set*, fd_set*, timeval*)'
select.resize(N, -1);
^~~~~~
island.cpp:49:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if (c == 0 || select[c] != -1 || select[parent[c]] != -1) continue;
^
island.cpp:49:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (c == 0 || select[c] != -1 || select[parent[c]] != -1) continue;
^
island.cpp:49:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if (c == 0 || select[c] != -1 || select[parent[c]] != -1) continue;
^
island.cpp:49:58: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (c == 0 || select[c] != -1 || select[parent[c]] != -1) continue;
^
island.cpp:50:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
select[c] = parent[c];
^
island.cpp:50:23: error: assignment of read-only location '*(select + ((sizetype)c))'
select[c] = parent[c];
^
island.cpp:50:23: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' to 'int(int, fd_set*, fd_set*, fd_set*, timeval*)' in assignment
island.cpp:51:19: warning: pointer to a function used in arithmetic [-Wpointer-arith]
select[parent[c]] = c;
^
island.cpp:51:23: error: assignment of read-only location '*(select + ((sizetype)parent.std::vector<int>::operator[](((std::vector<int>::size_type)c))))'
select[parent[c]] = c;
^
island.cpp:51:23: error: cannot convert 'int' to 'int(int, fd_set*, fd_set*, fd_set*, timeval*)' in assignment
island.cpp:55:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if (select[i] != -1 && i < select[i]) {
^
island.cpp:55:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if (select[i] != -1 && i < select[i]) {
^
island.cpp:55:38: warning: pointer to a function used in arithmetic [-Wpointer-arith]
if (select[i] != -1 && i < select[i]) {
^
island.cpp:55:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
island.cpp:56:47: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (ans.empty() || parent[ans.back()] != i && parent[i] != ans.back()) {
island.cpp:58:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
ans.push_back(select[i]);
^
island.cpp:58:28: error: no matching function for call to 'push_back(int (&)(int, fd_set*, fd_set*, fd_set*, timeval*))'
ans.push_back(select[i]);
^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from island.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:939: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] <near match>
push_back(const value_type& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note: conversion of argument 1 would be ill-formed:
island.cpp:58:27: error: invalid conversion from 'int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)' to 'std::vector<int>::value_type {aka int}' [-fpermissive]
ans.push_back(select[i]);
~~~~~~~~^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from island.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:953: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] <near match>
push_back(value_type&& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note: conversion of argument 1 would be ill-formed:
island.cpp:58:27: error: invalid conversion from 'int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)' to 'std::vector<int>::value_type {aka int}' [-fpermissive]
ans.push_back(select[i]);
~~~~~~~~^
island.cpp:61:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
ans.push_back(select[i]);
^
island.cpp:61:28: error: no matching function for call to 'push_back(int (&)(int, fd_set*, fd_set*, fd_set*, timeval*))'
ans.push_back(select[i]);
^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from island.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:939: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] <near match>
push_back(const value_type& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note: conversion of argument 1 would be ill-formed:
island.cpp:61:27: error: invalid conversion from 'int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)' to 'std::vector<int>::value_type {aka int}' [-fpermissive]
ans.push_back(select[i]);
~~~~~~~~^
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from island.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:953: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] <near match>
push_back(value_type&& __x)
^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note: conversion of argument 1 would be ill-formed:
island.cpp:61:27: error: invalid conversion from 'int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)' to 'std::vector<int>::value_type {aka int}' [-fpermissive]
ans.push_back(select[i]);
~~~~~~~~^