水题,模拟就行了,别忘了L>=r的时候直接更新下一个的L然后continue type node=record l,r:longint; end; var n,l,i,ans:longint; k:array[..] of node; function ma(a,b:longint):longint; begin if a>b then exit(a) else exit(b); end; procedure qs(t,w:longint); var mid,l,r:longint; tem:…