prog.cpp: In function ‘int main()’:
prog.cpp:32:4: error: reference to ‘rank’ is ambiguous
rank[i]=++cr;
^~~~
prog.cpp:5:16: note: candidates are: std::map<int, int> rank
map<int,int> m,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/istream:38,
from /usr/include/c++/6/sstream:38,
from /usr/include/c++/6/complex:45,
from /usr/include/c++/6/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
from prog.cpp:2:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
prog.cpp:41:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
v.push_back(pair<0,0 > );
^
prog.cpp:41:24: note: expected a type, got ‘0’
prog.cpp:41:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:41:24: note: expected a type, got ‘0’
prog.cpp:52:3: error: reference to ‘rank’ is ambiguous
rank[*j->first]=cr++;
^~~~
prog.cpp:5:16: note: candidates are: std::map<int, int> rank
map<int,int> m,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/istream:38,
from /usr/include/c++/6/sstream:38,
from /usr/include/c++/6/complex:45,
from /usr/include/c++/6/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
from prog.cpp:2:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~
prog.cpp:52:12: error: invalid type argument of unary ‘*’ (have ‘int’)
rank[*j->first]=cr++;
^~~~~
prog.cpp:58:9: error: reference to ‘rank’ is ambiguous
cout<<rank[i]<<endl;
^~~~
prog.cpp:5:16: note: candidates are: std::map<int, int> rank
map<int,int> m,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/istream:38,
from /usr/include/c++/6/sstream:38,
from /usr/include/c++/6/complex:45,
from /usr/include/c++/6/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
from prog.cpp:2:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~