题目链接: http://poj.org/problem?id=2253 Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' suns…
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int MAXV=1000; const int INF=100000000; int n,m,s,G[MAXV][MAXV]; int d[MAXV];//起点到达各点的最短路径长度 bool vis[MAXV]={false}; void Dijkstra(int s){ fill(d,d+MAXV,I…
Til the Cows Come Home Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possible.…