~~一个10,一个11~~
by andyli @ 2018-07-14 21:07:44
没有区别('<='是指小于**或**等于,满足其一即可)
by info___tion @ 2018-07-14 21:25:36
也可以实践一下:
input:
```cpp
printf("%d\n",10<11);
printf("%d\n",10<=11);
```
结果:
1
1
by info___tion @ 2018-07-14 21:26:28
sort如果加上等号的话会直接RE掉吧
by Tomarange @ 2018-07-14 21:38:56
同楼上 RE了
by zzq233 @ 2018-07-26 16:43:31
@[Hometown](/space/show?uid=8444) 为什么啊
by zzq233 @ 2018-07-26 16:43:48
@[ABC_zzq](/space/show?uid=106799) 这个……我也不知道 反正写的时候注意一点不加等号就好
by Tomarange @ 2018-07-26 18:53:04
我也发现了类似的问题
```cpp
using namespace std;
#include<iostream>
#include<algorithm>
int fa[110],bh=0;
int n;
int find(int x)
{
if(x==fa[x]) return x;
else return find(fa[x]);
}
struct edge
{
int from,to,dis;
} edges[21000];
bool cmp(edge a,edge b)
{
if(a.dis >=b.dis ) return 0;//此处写'>' 就是60分,求解释!
else return 1;
}
void add(int from,int to,int dis)
{
edges[bh].dis =dis;
edges[bh].to =to;
edges[bh].from =from;
bh++;
}
int main()
{
int x;
cin>>n;
for(int i=1;i<=n;i++)
{
fa[i]=i;
}//初始化并查集
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cin>>x;
if(x!=0&&j>i) add(i,j,x);
}
}
sort(edges,edges+bh,cmp);//按边的大小排列
int ans=0;
int s=1;
for(int i=0;i<=bh-1;i++)
{
edge a;
a= edges[i];
int x1=find(a.from ),x2= find(a.to );
if(x1!=x2)
{
ans+=a.dis ;
fa[x2]=x1;
s++;
}
if(s==n) break;
}
cout<<ans;
//cout<<edges[i].dis <<' ';
}
```
by Ecstasy7 @ 2018-08-07 11:33:48
@[jun君](/space/show?uid=56646) @[ABC_zzq](/space/show?uid=106799) @[Hometown](/space/show?uid=8444) @[Ecstasy7](/space/show?uid=98270)
#因为如果加了等号,如果两个数相等,就会两个数拼命互换,就卡RE/TLE
by 不会dp退役菜鸡 @ 2018-09-29 18:57:02