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. poj2420A Star not a Tree?(模拟退火)

    链接 求某一点到其它点距离和最小,求这个和,这个点 为费马点. 做法:模拟退火 #include <iostream> #include<cstdio> #include< ...

  2. JavaScript的事件对象_键盘事件

    用户在使用键盘时会触发键盘事件.“DOM2 级事件”最初规定了键盘事件,结果又删除了相应的内容.最终还是使用最初的键盘事件,不过 IE9 已经率先支持“DOM3”级键盘事件. 一.键码 在发生 key ...

  3. iOS开发 画六边形(多边形)

    - (void)drawRect:(CGRect)rect { UIBezierPath * path = [UIBezierPath bezierPath]; [path moveToPoint:C ...

  4. dom jaxp详解

    转自 http://blog.csdn.net/java958199586/article/details/7277904 一.XML解析技术概述 1.XML解析方式分为两种:dom和sax (1)d ...

  5. ListView 搭配SimpleAdapter

    这是SimplerAdapter的构造函数 public SimpleAdapter(Context context, List<? extends Map<String, ?>&g ...

  6. hook_schema 小总结

    1, primary key 可以带空格 做为下表 但field就不行 2, dev_node 仅为下标 'primary key' => array('nid'),    'foreign k ...

  7. android UI库

    https://github.com/wasabeef/awesome-android-ui List of Android UI/UX Libraries A curated list of awe ...

  8. 教你开启红米的USB大容量存储选项,全网首发哦

    教你开启红米的USB大容量存储选项,全网首发哦 http://bbs.7to.cn/thread-10732-1-1.html 发表于 2014-4-29 110643 红米note入手也有两天了.各 ...

  9. js获取随机数

    js 获取随机数方法如下: 1.Math.random()表示 结果为0-1间的一个随机数(包括0,不包括1) : 返回指定范围的随机数(m-n之间)的公式 Math.random()*(n-m)+m ...

  10. memset,memcpy,memcmp用法

    void* memset(void *s, int ch, size_t n); 将s所指向的某一块内存中的前n个字节的内容全部设置为ch指定的ASCII值. 例如:memset(lpMyStruct ...