
图
文章平均质量分 72
清溪浅水
这个作者很懒,什么都没留下…
展开
-
hdu ——3018——Ant Trip(一笔画问题)
Problem DescriptionAnt Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the country.They intend to vis原创 2013-10-24 15:57:36 · 787 阅读 · 0 评论 -
cf——Candies——(spfa)
DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distrib原创 2014-04-02 10:27:38 · 562 阅读 · 0 评论 -
链式前向星(图)
#include #include using namespace std;const int M=1005;int head[M];struct node{ int to; int w; int next;}Node[M];int main(){ int n,m; cin>>n>>m; memset(head,-1,size原创 2014-03-11 15:17:09 · 678 阅读 · 0 评论 -
uva——10054——项链
有一条用彩色珠子做的漂亮项链。每个珠子由两种颜色组成,相继的两个珠子在邻接处共享一种颜色:--(green | red) (red | white) (white | green) (green | blue)--有一天,项链线断了,珠子撒了一地。收集了地上的珠子,但无法肯定是否收齐。想知道用目前收集的珠子是否能够联成项链。输入51 22 33 4原创 2014-02-08 10:39:40 · 729 阅读 · 0 评论 -
poj——1160——Post Office
题目:用数轴描述一条高速公路,有V个村庄,每一个村庄坐落在数轴的某个点上,需要选择P个村庄在其中建立邮局,要求每个村庄到最近邮局的距离和最小。分析:经典DP1、考虑在V个村庄中只建立一个邮局的情况,显然可以知道,将邮局建立在中间的那个村庄即可。也就是在a到b间建立一个邮局,若使消耗最小,则应该将邮局建立在(a+b)/2这个村庄上(可以通过画图知道)。2、下面考虑建立多个邮局的问题,可以原创 2014-01-20 14:40:00 · 1438 阅读 · 0 评论 -
poj——1125——Stockbroker Grapevine
DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge原创 2014-01-20 11:11:32 · 596 阅读 · 0 评论 -
hdu——1285——确定比赛名次(拓扑)
Problem Description有N个比赛队(1 Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。原创 2014-01-23 19:07:32 · 488 阅读 · 0 评论 -
poj——1094——Sorting It All Out(拓扑排序)
DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequenc原创 2014-01-23 15:59:54 · 695 阅读 · 0 评论 -
poi(拓扑排序)
给出一个图的结构,输出其拓扑排序序列,要求在同等条件下,编号小的顶点在前输入若干行整数,第一行有2个数,分别为顶点数v和弧数a,接下来有a行,每一行有2个数,分别是该条弧所关联的两个顶点编号输出若干个空格隔开的顶点构成的序列(用小写字母)样例输入6 81 21 31 43 23 54 56 46 5样例输出v1 v3 v2 v6 v4 v原创 2014-01-23 21:05:04 · 1186 阅读 · 0 评论 -
Strange Country II
DescriptionYou want to visit a strange country. There are n cities in the country. Cities are numbered from 1 to n. The unique way to travel in the country is taking planes. Strangely, in this stran原创 2013-11-18 09:40:55 · 631 阅读 · 0 评论 -
poj——2230——Watchcow(欧拉路+dfs)
DescriptionBessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes原创 2013-10-26 10:23:20 · 1183 阅读 · 0 评论 -
hdu ——1116——Play on Words(欧拉路有向图)
Problem DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, th原创 2013-10-25 11:43:58 · 593 阅读 · 0 评论 -
hdu——1878——欧拉路(并查集)
Problem Description欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 束。 Output每个测试用例的输出占一行,若欧拉回路存在则输出1,否则输出0。 Sample原创 2013-10-24 17:32:41 · 691 阅读 · 0 评论 -
poj——3159——Candies(spfa)
DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distrib原创 2014-04-10 18:11:25 · 567 阅读 · 0 评论