HDU 4171 Paper Route】的更多相关文章

Problem Description As a poor, tuition-ridden student, you've decided to take up a part time job as a paperboy/papergirl.You've just been handed your paper route: a set of addresses (conveniently labelled 1 to N). Every morning, you start at the news…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4171 题意: 有n+1个点,这n+1个点由n条边相连,且保证连通.然后给出各个点到出口的距离,要求从0点出发,遍历完n个点后立刻从出口出去.求最少时间. 首先,要读懂题意,在遍历过程中不能以校园作为中转.. 当然这是废话了 然后我们很容易知道对于n+1个点,并且有n个边相连的连通图肯定是一颗树 对于树, 我们应该熟悉这样一条性质: 从跟节点出发遍历一颗树的所有节点再回到跟节点的花费为一定为他的所有…
#include<stdio.h> #include<string.h> #include<queue> #include<iostream> using namespace std; #define inf 1000000000 #define N 110000 struct node { int u,v,w,next; }bian[N*2]; int head[N],yong,mindistance[N],n,visit[N],countt[N]; vo…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2680 Choose the best route Description One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a ma…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5224 Tom and paper Description There is a piece of paper in front of Tom, its length and width are integer. Tom knows the area of this paper, he wants to know the minimum perimeter of this paper. Input I…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4240 A city is made up exclusively of one-way steets.each street in the city has a capacity,which is the minimum of the capcities of the streets along that route. The redundancy ratio from point A to poi…
HDU 5224 Tom and paper(最小周长) Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u   Description There is a piece of paper in front of Tom, its length and width are integer. Tom knows the area of this paper, he wants to know th…
[hdu P1599] find the mincost route 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区.现在8600需要你帮他找一条这样的路线,并且花费越少越好.  Input第一行是2个整数N和M(N <= 100, M <= 1000),代表景区的个数和道路的条…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1599 find the mincost route Time Limit: 1000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7047    Accepted Submission(s): 2736 Problem Description 杭州有N个景区,景区之间有一…
http://acm.hdu.edu.cn/showproblem.php?pid=2164 Problem Description Rock, Paper, Scissors is a two player game, where each player simultaneously chooses one of the three items after counting to three. The game typically lasts a pre-determined number o…