![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
----图论
文章平均质量分 65
chenchenT_
这个作者很懒,什么都没留下…
展开
-
-----染色问题 hdu 5971-Wrestling Match
Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is “good player”, the rest is “bad player”. Now, Xiao Ming is referee of the wrestling ma原创 2017-07-02 23:39:19 · 595 阅读 · 0 评论 -
hdu 3790 最短路径问题
Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。(1<n<...原创 2018-03-22 21:05:16 · 239 阅读 · 0 评论 -
ccf 2017-12-4 行车路线
问题描述 小明和小芳出去乡村玩,小明负责开车,小芳来导航。 小芳将可能的道路分为大道和小道。大道比较好走,每走1公里小明会增加1的疲劳度。小道不好走,如果连续走小道,小明的疲劳值会快速增加,连续走s公里小明会增加s2的疲劳度。 例如:有5个路口,1号路口到2号路口为小道,2号路口到3号路口为小道,3号路口到4号路口为大道,4号路口到5号路口为小道,相邻路口之间的距离都是2公里...原创 2018-03-18 14:59:09 · 1059 阅读 · 0 评论 -
二分匹配-hdu-1045-Fire Net
Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall. A blockhouse is a small castle that原创 2017-12-04 18:58:16 · 455 阅读 · 0 评论 -
-----tarjan强连通分量缩点-hdu 5934 -Bomb
套个模板都整了好几天…..尴尬 There are NN bombs needing exploding. Each bomb has three attributes: exploding radius riri, position (xi,yi)(xi,yi) and lighting-cost cici which means you need to pay cici cost making原创 2017-10-06 21:04:18 · 505 阅读 · 0 评论 -
-----dfs+思维 hdu 6060-RXD and dividing
http://acm.hdu.edu.cn/showproblem.php?pid=6060 传送门题目大意: 有一棵树T,n个点,n-1条边;将2,3,4,5,6,… n分到k个集合里面S1,S2,S3,… Sk;集合可以是空集,并且任意两个集合之间没有相同的点;定义一个函数f(S)=f({1}USi)为集合S中的最小斯坦纳树,即为每个集合中所有点加编号为1的节点相互连接所经过的边的权值之和,求原创 2017-08-05 14:16:45 · 306 阅读 · 0 评论 -
-----图论建图:模板
链式前向星: #include <iostream> #include<stdio.h> #include<vector> #include<cstring> using namespace std;int n,m; struct node { int to,w,next; } G[105]; int head[105]; int main() { int x,y,z; ci原创 2017-05-04 16:33:08 · 608 阅读 · 0 评论 -
-----最短路 最大值 hdu 5137-How Many Maos Does the Guanxi Worth
“Guanxi” is a very important word in Chinese. It kind of means “relationship” or “contact”. Guanxi can be based on friendship, but also can be built on money. So Chinese often say “I don’t have one mao原创 2017-07-31 10:23:43 · 329 阅读 · 0 评论 -
-----模板spfa+邻接表,spfa+链式前向星
自己胡乱整理的…有错欢迎纠正#include<cstdio> #include<iostream> #include<cstring> #include<queue> #include<vector> #define INF 0x3f3f3f3f using namespace std;///临接表,spfa const int maxn=1e8+10; int n,m; struct n原创 2017-06-12 17:32:35 · 508 阅读 · 1 评论 -
最小生成树-poj-3228 Gold Transportation
Gold TransportationTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 3590 Accepted: 1284DescriptionRecently, a number of gold mines have been discovered in Zorroming State. To protect this tre...原创 2018-04-01 23:56:56 · 239 阅读 · 0 评论