本来是学 lct 的题单刷到的。然后这题不会用 lct,就先用别的做法试了一下,然后过了。 3s 时限,最慢的点只跑了不到 900ms。
O(nlog3n)O(n\log^3 n)O(nlog3n) 做法,题解区貌似没有。
link