这题预处理稍微动动脑,其实还是个裸的置换群=-=,没什么压力. ; var n,i,j,minx,tem,now,tmin,len:longint; cursum,sum:int64; pos,num,tnum,ys:array[..maxn] of longint; p:array[..maxn] of boolean; function min(a,b:longint):longint; begin if a>b then exit(b) else exit(a); end; begin r…