treap pascal实现 var left,weight,right,size,element:array[1..100000] of longint; root,totnode:longint; procedure update(k:longint); begin size[k]:=size[left[k]]+size[right[k]]+1; end; function merge(a,b:longint):longint;