在sort的时候,一般都是用<或者>的,但是之前写代码的时候写成了≤,然后发现RE了,而≥好像又不会RE,问一下为什么
下面是一个简单的代码,也会导致RE,而换成≥后就不会RE了
#include <bits/stdc++.h>
using namespace std;
int num[100010];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
mt19937 rnd((unsigned)time(nullptr));
for (int i = 1; i <= 100000; i++) num[i] = rnd() % 100;
sort(num + 1, num + 100001, [&](const int &a, const int &b) {return a <= b;});
return 0;
}