
图论
Merry_hj
不完美小孩的完美梦想
展开
-
HDU 1598 find the most comfortable road 贪心+并查集
Problem Description XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬原创 2017-07-20 12:44:09 · 333 阅读 · 0 评论 -
hdu 1599 find the mincost route(Floyd)
Problem Description 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,….VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。Input 第一行是2个整数N和M(N <=原创 2017-07-22 18:00:02 · 423 阅读 · 0 评论 -
hdu 1596 find the safest road (最短路径dijkstra SPFA Floyd)
Problem Description XX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是860原创 2017-07-19 11:25:50 · 380 阅读 · 0 评论 -
hdu 6073 Matching In Multiplication (二分图与拓补排序)
Problem Description In the mathematical discipline of graph theory, a bipartite graph is a graph whose vertices can be divided into two disjoint sets U and V (that is, U and V are each independent set原创 2017-08-05 13:30:51 · 553 阅读 · 2 评论 -
Colorful Tree(逆向思维)
Problem Description There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci.The path between each two different nodes is unique, of w原创 2017-08-06 00:00:14 · 1305 阅读 · 0 评论