uva 10245 The Closest Pair Problem
来源:互联网 发布:网络用语鸡肋什么意思 编辑:程序博客网 时间:2024/06/04 10:02
这道题是给大家寻开心的,灵光一闪,你就会了,我写这份报告也是寻开心的。。。。。。。。。。。。。。。我就笑了。。。。。你可以先做这一道玩玩。。。哒哒哒。。。。啊啦上海侬
#include <cstdio>#include <cmath>struct point{ double x; double y;};/*struct edge{ point a; point b; double dis;};*/double diss( point a,point b){ return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y- b.y));}int main(){ int n,i,j; point p[10010]; //edge e[10010]; while(scanf("%d",&n)&&n) { double MIN,_min; MIN = 1 << 30; for( i = 0; i < n; i ++) { scanf("%lf %lf",&p[i].x,&p[i].y); } for(i =0;i < n-1;i++) { for(j=i+1;j<n;j++) { _min = diss(p[i],p[j]); if(_min < MIN) { MIN = _min; } } } if(MIN >= 10000) printf("INFINITY\n"); else printf("%.4lf\n",MIN); } return 0;}
1 0
- UVa 10245 - The Closest Pair Problem
- UVa 10245 - The Closest Pair Problem
- uva 10245 - The Closest Pair Problem
- [uva] 10245The Closest Pair Problem
- UVa 10245 - The Closest Pair Problem
- UVA 10245 - The Closest Pair Problem
- uva 10245 The Closest Pair Problem
- uva 10245 The Closest Pair Problem
- UVa 10245 - The Closest Pair Problem
- UVa 10245 - The Closest Pair Problem
- UVa 10245 - The Closest Pair Problem
- UVA 10245 - The Closest Pair Problem
- UVA - 10245 The Closest Pair Problem
- UVA - 10245 The Closest Pair Problem
- uva 10245 The Closest Pair Problem
- uva 10245 The Closest Pair Problem
- UVA 10245 The Closest Pair Problem【分治】
- UVA 10245 The Closest Pair Problem
- enum类使用理解2
- linux线程资源回收方法
- VS2010 fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- 【mke2fs】ext系列文件系统创建管理工具
- 进程与线程的一个简单解释
- uva 10245 The Closest Pair Problem
- 直接插入排序
- leetcode--最长非重复子序列--O(n)--基于队列
- jsp自定义标签 tag版(jsp) tld版(java)
- 图片上传不到服务器
- c++继承与多态
- automake工具集使用
- android studio 安装(mac)
- HDU 1556 Color the ball(线段树的区间更新【注释】)