分析:http://blog.csdn.net/chenzhenyu123456/article/details/51308460

#include <cstdio>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
typedef long long LL;
typedef pair<int,int>pii;
const int N=8e2+;
const int INF=0x3f3f3f3f;
struct Node{
int u,v,w;
bool operator<(const Node &rhs)const{
return w<rhs.w;
}
}p[N*N];
int tot,n,w,fa[N];
int find(int x){
return x==fa[x]?x:fa[x]=find(fa[x]);
}
int main(){
while(~scanf("%d",&n)){
tot=;
for(int i=;i<=n;++i){
fa[i]=i;
for(int j=;j<=n;++j){
scanf("%d",&w);
if(i<j){++tot,p[tot].u=i,p[tot].v=j,p[tot].w=w;}
}
}
sort(p+,p++tot);
int ans=;
for(int i=;i<=tot;++i){
int u=find(p[i].u),v=find(p[i].v);
if(u!=v){
fa[u]=v;
ans=p[i].w;
}
}
printf("%d\n",ans);
}
return ;
}

最新文章

  1. 将GridView数据导入到excel,并提供下载
  2. 学习笔记——Maven pom.xml配置详解
  3. JS学习笔记(四) 正则表达式(RegExp对象)
  4. 正整数转换成N进制的数组
  5. pthread_setcanceltype 线程取消
  6. WPF - 如何引用external dll中图片
  7. Coroutine,你究竟干了什么?
  8. Beijing Perl Workshop - Augest 10th, 2013
  9. Oracle 免费的数据库
  10. 运维必备:Oracle自备份精简教程(linux及win)
  11. R语言-动画
  12. Mysql变量列表
  13. 网易面经(Java开发岗)
  14. Clustering[Introduction]
  15. React-router4 简单总结
  16. VIM编码检查
  17. []map[][]切片map小计
  18. python使用(二)
  19. postgresql 指令
  20. animate动画回调函数

热门文章

  1. 点击按钮文字变成input框,点击保存变成文字
  2. php 命名空间(要求php5.3以上)
  3. 使用jQuery.FileUpload插件和服Backload组件自定义上传文件夹
  4. animation css3动画与CSS3 @keyframes担配使用创建往复平缓动画
  5. CentOS 6.4 安装SecurectCRT并破解
  6. C语言杂记
  7. ruby的gem和boundle安装解决办法
  8. int([x[, base]]) : 将一个字符转换为int类型,base表示进制
  9. hdu 3480
  10. Linux 串行终端,虚拟终端,伪终端,控制终端,控制台终端的理解