rt。请检查你 sort 询问时是否写了 sort(q + 1, q + m + 1, cmp); 而不是 sort(q + 1, q + n + 1, cmp);
sort(q + 1, q + m + 1, cmp);
sort(q + 1, q + n + 1, cmp);