那些年踩过的坑 std::sort() std::sort() 使用自定义比较函数时 手欠,元素对比 写了 return a <= b; 结果数组越界,程序崩溃。 sort内部算法优化,必须保证比较函数保证弱序