其实和bzoj2724是一样的都是先处理多个块的答案,然后多余部分暴力空间要注意一下,还是O(nsqrt(n)); ..,..] of longint; g:..,..] of longint; a,s,be:..] of longint; t,n,p,m,i,x,y,ans,size:longint; procedure swap(var a,b:longint); var c:longint; begin c:=a; a:=b; b:=c; end; function min(a,b:lon…