链接:https://ac.nowcoder.com/acm/contest/6362/A Two arrays u and v each with m distinct elements are called equivalent if and only if RMQ(u,l,r)=RMQ(v,l,r)\mathrm{RMQ}(u, l, r) = \mathrm{RMQ}(v, l, r)RMQ(u,l,r)=RMQ(v,l,r) for all 1≤l≤r≤m1 \leq l \leq r \leq m1≤l≤r≤m where RMQ(w,l,r)\mathrm{RMQ}(w, l, ...