/in/foo.cc:22:1: error: reference to 'rank' is ambiguous
rank p[100001],q[100001];
^~~~
/in/foo.cc:18:8: note: candidates are: struct rank
struct rank
^~~~
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:24:10: error: reference to 'rank' is ambiguous
bool cmp(rank u,rank v)
^~~~
/in/foo.cc:18:8: note: candidates are: struct rank
struct rank
^~~~
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:24:17: error: reference to 'rank' is ambiguous
bool cmp(rank u,rank v)
^~~~
/in/foo.cc:18:8: note: candidates are: struct rank
struct rank
^~~~
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:24:23: error: expression list treated as compound expression in initializer [-fpermissive]
bool cmp(rank u,rank v)
^
/in/foo.cc: In function 'int main()':
/in/foo.cc:61:3: error: 'p' was not declared in this scope
p[a[i].rank].num=a[i].num;
^
/in/foo.cc:68:3: error: 'q' was not declared in this scope
q[b[i].rank].num=b[i].num;
^
/in/foo.cc:71:7: error: 'p' was not declared in this scope
sort(p+1,p+n+1,cmp);
^
/in/foo.cc:72:7: error: 'q' was not declared in this scope
sort(q+1,q+n+1,cmp);
^