/in/foo.cc:18:47: error: 'map' does not name a type
int n,m,sz[N],tot,L[N],R[N],root,id[N],val[N];map<int,int>M;
^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:24:24: error: 'sort' was not declared in this scope
sort(xx+1,xx+n+m+1,cmp);
^
/in/foo.cc:24:24: note: suggested alternative:
In file included from /usr/include/c++/6/algorithm:62:0,
from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_algo.h:4727:5: note: 'std::sort'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^~~~
/in/foo.cc:27:7: error: 'M' was not declared in this scope
if(!M.count(xx[i].t))
^