/in/foo.cc: In function 'int main()':
/in/foo.cc:43:52: error: reference to 'rank' is ambiguous
for(int i=1;i<=n;++i) update(1,Size,rt[i-1],rt[i],rank(a[i]));
^~~~
/in/foo.cc:17:5: note: candidates are: int rank(int)
int rank(int x) {return lower_bound(b+1,b+1+Size,x)-b;}
^~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
from /usr/include/c++/6/bits/stl_pair.h:59,
from /usr/include/c++/6/utility:70,
from /usr/include/c++/6/algorithm:60,
from /in/foo.cc:1:
/usr/include/c++/6/type_traits:1482:12: note: template<class> struct std::rank
struct rank
^~~~