先看代码:
解释:使用自定义比较函数时,如果用了返回值恒为$true$或者恒为$false$的比较函数,就会这样子。
原因:
https://stackoverflow.com/questions/41488093/why-do-i-get-runtime-error-when-comparison-function-in-stdsort-always-return-t
所以,使用cmp函数时,一定要十分注意写法,否则,真的会RE和TLE到怀疑人生。