RT,我按这样读入在ide上没有输出:
int q=read(); while(q--){ char c; scanf("%c",&c); //cin>>c; int x=read(),y=read(); if(c=='Q'){ int p=get_kth(root[fin(x)],y); printf("%d\n",p); if(p!=-1) splay(p,0); }else merge(x,y); }
但我把上面这份代码的 scanf 改成 cin 就又有输出了,不太明白为什么,求好心的巨佬解答,谢谢!