http://poj.org/problem?id=2253

#include <iostream>
#include <queue>
#include <cmath>
#include <iomanip>
using namespace std;
queue <int > que;
int co[202][2];
double d[202][202],u[202][202];
int n;
int main(){
ios::sync_with_stdio(false);
int t=0;
while(cin>>n&&n){
t++;
for(int i=0;i<n;i++){
cin>>co[i][0]>>co[i][1];
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
u[i][j]=(co[i][0]-co[j][0])*(co[i][0]-co[j][0])+(co[i][1]-co[j][1])*(co[i][1]-co[j][1]);
d[i][j]=sqrt(u[i][j]);
}
}
for(int k=0;k<n;k++){
for(int j=0;j<n;j++){
for(int i=0;i<n;i++){
if(d[i][j]>max(d[i][k],d[k][j])){
d[i][j]=max(d[i][k],d[k][j]);
}
}
}
}
cout<<"Scenario #"<<t<<endl;
cout<<"Frog Distance = "<<setiosflags(ios::fixed)<<setprecision(3)<<d[0][1]<<endl<<endl;
}
return 0;
}

  

POJ 2253 Frogger 最短路 难度:0的更多相关文章

  1. POJ 2253 Frogger (最短路)

    Frogger Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 28333   Accepted: 9208 Descript ...

  2. poj 2253 Frogger(最短路 floyd)

    题目:http://poj.org/problem?id=2253 题意:给出两只青蛙的坐标A.B,和其他的n-2个坐标,任一两个坐标点间都是双向连通的.显然从A到B存在至少一条的通路,每一条通路的元 ...

  3. POJ 2253 Frogger -- 最短路变形

    这题的坑点在POJ输出double不能用%.lf而要用%.f...真是神坑. 题意:给出一个无向图,求节点1到2之间的最大边的边权的最小值. 算法:Dijkstra 题目每次选择权值最小的边进行延伸访 ...

  4. POJ 2253 Frogger ( 最短路变形 || 最小生成树 )

    题意 : 给出二维平面上 N 个点,前两个点为起点和终点,问你从起点到终点的所有路径中拥有最短两点间距是多少. 分析 : ① 考虑最小生成树中 Kruskal 算法,在建树的过程中贪心的从最小的边一个 ...

  5. 最短路(Floyd_Warshall) POJ 2253 Frogger

    题目传送门 /* 最短路:Floyd算法模板题 */ #include <cstdio> #include <iostream> #include <algorithm& ...

  6. POJ 2253 Frogger(dijkstra 最短路

    POJ 2253 Frogger Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fion ...

  7. POJ 2253 Frogger ,poj3660Cow Contest(判断绝对顺序)(最短路,floyed)

    POJ 2253 Frogger题目意思就是求所有路径中最大路径中的最小值. #include<iostream> #include<cstdio> #include<s ...

  8. POJ. 2253 Frogger (Dijkstra )

    POJ. 2253 Frogger (Dijkstra ) 题意分析 首先给出n个点的坐标,其中第一个点的坐标为青蛙1的坐标,第二个点的坐标为青蛙2的坐标.给出的n个点,两两双向互通,求出由1到2可行 ...

  9. poj 2253 Frogger (dijkstra最短路)

    题目链接:http://poj.org/problem?id=2253 Frogger Time Limit: 1000MS   Memory Limit: 65536K Total Submissi ...

随机推荐

  1. ORACLE 总结

    1. diagnostic file(alertlog, tracefile, redolog), 监控数据库动作时间点 [troubleshooting] alertlog : 确认checkpoi ...

  2. poj1981Circle and Points(单位圆覆盖最多的点)

    链接 O(n^3)的做法: 枚举任意两点为弦的圆,然后再枚举其它点是否在圆内. 用到了两个函数 atan2反正切函数,据说可以很好的避免一些特殊情况 #include <iostream> ...

  3. odoo关联表查询方法

    testinfo=self.env['product.attribute.value'].search([('product_ids.product_tmpl_id','=',2047)]) for ...

  4. oracle中between

    oracle中between and包含边界值,也就是所谓的闭区间. 如 between 1 and 100,则表示包含1和100及以内的一切数值. 如以下语句: 1 2 3 4 5 6 7 8 9 ...

  5. $.extend abc

    console.log(jQuery.extend(this,{'a':'b'},{'c':'d'}));console.log(this.a)var tt = jQuery.extend({},{' ...

  6. 使用Visual Studio制作安装包

    目 录 第1章 合并模块    3 1.1 SystemDll    3 1.1.1 收集文件    3 1.1.2 新建项目    4 1.1.3 增加自定义文件夹    4 1.1.4 设置部署位 ...

  7. [saiku] 系统登录成功后查询Cubes

    一.系统启动时初始化ds和conn 1.查询出目前系统拥有的Datasources和Connections放入内存中 2.比对saiku-datasources中的ds是否有新增的,如果有,创建新的d ...

  8. Innodb中的事务隔离级别和锁的关系

    前言: 我们都知道事务的几种性质,数据库为了维护这些性质,尤其是一致性和隔离性,一般使用加锁这种方式.同时数据库又是个高并发的应用,同一时间会有大量的并发访问,如果加锁过度,会极大的降低并发处理能力. ...

  9. javascript实现对象的继承的方式

    在JavaScript将原型链作为实现继承的主要方法.基本原理是利用原型让一个subType引用superType的属性和方法 推荐链接 http://www.jb51.net/article/204 ...

  10. hdu----(2586)How far away ?(DFS/LCA/RMQ)

    How far away ? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...