
———其他图论
MissZhou要努力
不晓日月,不辩兰艾,终日碌碌,安与燕雀相随乎
展开
-
HDU 4337 King Arthur's Knights 【哈密顿模板题】
DescriptionI am the bone of my sword. Steel is my body, and the fire is my blood.- from Fate / Stay Night You must have known the legend of King Arthur and his knights of the round table. Th原创 2016-04-03 17:56:58 · 508 阅读 · 0 评论 -
poj1776Task Sequences【竞赛图的哈密顿路径】
DescriptionTom has received a lot of tasks from his boss, which are boring to deal with by hand. Fortunately,Tom got a special machine - Advanced Computing Machine (ACM) to help him.ACM works in a原创 2016-07-05 21:13:20 · 995 阅读 · 0 评论 -
hduTour Route【竞赛图的哈密顿回路】
Problem DescriptionThe city is so crowded that the mayor can't bear any longer. He issued an order to change all the roads into one-way street. The news is terrible for Jack, who is the director of原创 2016-07-05 21:05:10 · 759 阅读 · 0 评论 -
hdu2094产生冠军
Input输入含有一些选手群,每群选手都以一个整数n(n Output对于每个选手群,若你判断出产生了冠军,则在一行中输出“Yes”,否则在一行中输出“No”。只是需要判断冠军嘛STL是个好东西啊·~set自动判重#include#include#include#includeusing namespace std;in原创 2015-08-17 19:37:32 · 515 阅读 · 0 评论 -
hdu2647reward
InputOne line with two integers n and m ,stands for the number of works and the number of demands .(nthen m lines ,each line contains two integers a and b ,stands for a's reward should be more tha原创 2015-08-17 19:42:37 · 327 阅读 · 0 评论 -
hdu2586How far away ?【LCA tarjan求最短距离】
这个题比普通的LCA只多了一个求距离,然后就把我华丽丽的困住了==当然了,我用的LCA是离线版的并查集那种模板是邝斌的那种,LCA 不难理解,就是dfs树+并查集 ,但是距离加在哪里??机智如我想到了在递归的时候求~然而写进去还找错位置了,原因在于应该写成dis[v]=dis[u]+edge[i].len;而不是dis[v]+=edge[i].len;然后就是距离的求法dis[u] +原创 2015-11-25 21:39:27 · 1201 阅读 · 0 评论 -
hdu2460Network【双连通分量求桥 在线求lca】
SubmitStatusDescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly原创 2016-05-11 16:09:09 · 682 阅读 · 0 评论 -
hdu3018Ant Trip【欧拉道路数量 并查集】
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 visit e原创 2016-03-16 19:13:05 · 1572 阅读 · 1 评论 -
hdu1285确定比赛名次(最简单的拓扑排序)
Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。 开始想难了XD,还一个劲儿研究怎么套该死的前向星模板 然而一个while套两个fo原创 2015-08-17 19:34:27 · 464 阅读 · 0 评论 -
CodeForces 508D Tanya and Password欧拉路径
那可是D题啊@。@ 做不上我心安了http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88120#problem/BDescriptionWhile dad was at work, a little girl Tanya decided to play with dad's password to his s原创 2015-08-20 17:00:25 · 596 阅读 · 0 评论 -
POJ 2513 Colored Sticks 欧拉回路+trie树
题目DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of原创 2015-08-20 17:13:48 · 468 阅读 · 0 评论 -
POJ 1386 Play on Words 欧拉回路
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, the puzz原创 2015-08-20 17:22:34 · 394 阅读 · 0 评论 -
hdu2874Connections between cities【LCA tarjan】
LCA比较基础的题,而且貌似自己的代码只是MLE而已,结果没问题 ,而且也只是超了一点~mark一下别人过的2168MS21700K2458B#include #include #include #include #include #include #include #include #include #include #原创 2015-11-27 13:24:21 · 652 阅读 · 0 评论 -
spoj Count on a tree【主席树+在线LCA】
10628. Count on a treeProblem code: COT You are given a tree with N nodes.The tree nodes are numbered from 1 to N.Each node has an integer weight.We will ask you to perform t原创 2016-01-25 23:36:49 · 838 阅读 · 1 评论 -
poj3687Labeling Balls【反向拓扑排序 模板】
折腾了将近两个小时总算在discuess的只言片语中知道自己错在哪里了,怎么说也是没参考别人代码A的,但是思维严谨性啊……自己写测试数据!自己好好读题!1.题中有一句特别坑爹的话:For each test case output on a single line the balls' weights from label 1 to labelN. 输出的是这个数字所在的位置 ,不是这个位原创 2016-02-03 15:55:05 · 576 阅读 · 0 评论 -
UVALive 4255 Guess【拓扑排序 】
题目转不过来:点击打开链接这个题真是万万没想到是拓扑排序啊啊啊,以为和之前有一个变换质数的题一样是深搜==挑了半天没看出来哪里错了⊙﹏⊙b汗先说拓扑排序是什么来着,这也是扔了几乎半年的知识点==,通过找连着的边,让点的入度减少,入度为0的点入队列,从而形成一条可行路径==这题是白书训练指南310页的例题,“连续和转化为前缀之和”这个性质我想到了,但是没想到正负号就可以确定前后两个前缀和从而在拓原创 2016-03-15 21:39:34 · 508 阅读 · 0 评论 -
poj2438 Children's Dining【哈密顿图模板题】
DescriptionUsually children in kindergarten like to quarrel with each other. This situation annoys the child-care women. For instant, when diner time comes, a fierce conflict may break out when a原创 2016-03-19 15:25:23 · 666 阅读 · 0 评论 -
hdu4948Kingdom【拓扑排序】2014 多校联合
Problem DescriptionTeacher Mai has a kingdom consisting of n cities. He has planned the transportation of the kingdom. Every pair of cities has exactly a one-way road.He wants develop this kingd原创 2016-06-29 21:58:11 · 509 阅读 · 0 评论