![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
板子
a
essenge
顺势而为
展开
-
Kuangbin 专题六 最小生成树
1.给N个点 建立一支最小生成树 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; const int maxn=207; int n,m; int d[maxn][maxn]; int dis[maxn],ans; bool v[maxn]; int main(){ while(scanf("%d",&n)!=EOF&原创 2021-04-28 21:16:44 · 129 阅读 · 0 评论 -
二分1
力扣69 给定一个非负整数,求它的开方,并向下取整 1.二分 int mySqrt(int a){ if(a==0) return a; long long l=1,r=a,mid,sqrt; while(l<=r){ mid=(r+l)/2; sqrt=a/mid; if(sqrt==mid) { return mid; }else if(mid>sqrt) { r=mid-1; }else { l=mid+1; } } return r;原创 2021-04-18 10:39:14 · 93 阅读 · 0 评论