
最短路
文章平均质量分 78
sortmin
这个作者很懒,什么都没留下…
展开
-
最短路 - A - Til the Cows Come Home POJ - 2387
A - Til the Cows Come HomeBessie 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 beaut原创 2017-09-02 21:13:34 · 265 阅读 · 0 评论 -
最短路 -B - Frogger POJ - 2253
B - FroggerFreddy 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 fu原创 2017-09-03 10:50:49 · 233 阅读 · 0 评论 -
最短路 - C - Heavy Transportation POJ - 1797
C-Heavy Transportation POJ - 1797Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether ther原创 2017-09-03 11:28:59 · 238 阅读 · 0 评论 -
UVA10048 - Audiophobia
UVA10048 - Audiophobia题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=989题意:给定N个点M条边,给定q个询问,询问x-y的路径上使得经过的每条边...原创 2018-05-20 00:00:52 · 243 阅读 · 0 评论 -
UVa-1347 -Tour(DP)
题意:给定二维平面上的n个坐标,然后找到一条线路,从最左边的点出发,然后到最右边的点,然后再返回,只有起点和终点的点可以经过两次。找一条最短路。题解:走过去再走回来不经过相同的点可以转换为两个人分别走两条路去到达终点,用dp[i][j]表示两人最远的走到max(i,j)的情况,那么下一个决策就是看谁去走下一个点,即d[i][j]=min(dp[i+1][j]+dist[i][j],dp[i+1][...原创 2018-07-16 14:29:22 · 197 阅读 · 0 评论 -
Codeforces Round #495 (Div. 2) (ABCE) 题解
题目链接:http://codeforces.com/contest/1004A题题意:Sonya想在N个城市之间开店,他的每个店到城市的距离为d,求最多能开多少家店。A题题解:遍历相邻两城市距离,大于2*d就可以开两家,等于开一家,小于不能开即可。AC代码:#include <bits/stdc++.h>using namespace std;#define _for(i,a,b...原创 2018-07-07 02:23:34 · 250 阅读 · 0 评论