离散化的时候,如果只比较数值,那么重复的数值会卡掉你。
解决方案,将 std::sort 改为 std::stable_sort 即可解决。
std::sort
std::stable_sort
(调了1个月)