
图论一顿套模板
文章平均质量分 82
蒟蒻的ACMer
2014界大学新生
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 3790 最短路径问题 dij
G - 最短路径问题 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。原创 2016-03-29 14:50:41 · 559 阅读 · 0 评论 -
山东省第一届ACM大学生程序设计竞赛 Emergency floyd变形
Emergency Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Kudo’s real name is not Kudo. Her name is Kudryavka Anatolyevna Strugatskia, and Kudo is only her nickname.原创 2016-05-03 15:57:02 · 893 阅读 · 0 评论 -
HDU 5438 Ponds
题意: 给你n个点m条边。 每次删除度为一的点和其对应的边,如果有新的度为一的点就继续前面的操作。 最后输出各个联通分量中个数为奇数的点权和 ACcode: #include #include #include #include #define ll long long int #define maxn 100005 using namespace std; struct N{i原创 2016-06-11 13:30:01 · 336 阅读 · 0 评论 -
sdut 3262 Circle of Friends tarjan
Circle of Friends Time Limit: 2000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Nowadays, "Circle of Friends" is a very popular social networking platform in WeChat. We can share our原创 2016-05-21 11:08:49 · 645 阅读 · 0 评论 -
POJ 2253 Frogger 最短路径 Floyed-Warshall算法
Frogger Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 31519 Accepted: 10163 Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly原创 2015-10-23 21:05:25 · 664 阅读 · 0 评论 -
图的储存 模板
图的储存的几种方式 * 前向星 #pragma warning(disable:4786)//使命名长度不受限制 #pragma comment(linker, "/STACK:102400000,102400000")//手工开栈 #include #include #include #include #include #include #include #include #原创 2015-11-12 13:55:46 · 535 阅读 · 0 评论 -
HDU 3622 Bomb Game 2-sat +2分
C - Bomb Game Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 3622 Appoint description: Description Robbie is playing an interes原创 2016-04-19 09:43:26 · 466 阅读 · 0 评论 -
南京理工校赛同步 I题 puzzle 2-sat+二分
puzzle Time Limit: 1000MS Memory Limit: 65536KB [显示标签] Description 小明在玩一个闯关游戏,共n关,必须按顺序通过,每一关会遇到两个数字(可能一样),他要选择其中一个,如果要选的这个数字是他之前选过的就直接过了这关。但是他如果在某一关选了数字X,那就不能在经过另一关时选择数字Y当X+Y=2*n-1时,如果在某一关原创 2016-04-18 21:26:53 · 747 阅读 · 0 评论 -
HDU 1824 Let's go home 2-Sat
B - Let's go home Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1824 Appoint description: Description 小时候,乡愁是一枚小小的邮票,我在这头,母亲在那原创 2016-04-18 20:16:51 · 478 阅读 · 0 评论 -
HDU 3062 Party 2-SAT
A - Party Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 3062 Appoint description: Description 有n对夫妻被邀请参加一个聚会,因为场地的问题,每对夫妻中只有原创 2016-04-18 18:47:31 · 399 阅读 · 0 评论 -
POJ 1422 Air Raid 最小覆盖点
Air Raid Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7521 Accepted: 4478 Description Consider a town where all the streets are one-way and each street原创 2015-11-17 18:55:53 · 697 阅读 · 0 评论 -
POJ 3308 Paratroopers 最小点权覆盖Dinic
F - Paratroopers Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description It is year 2500 A.D. and there is a terrible war between the f原创 2015-11-20 23:28:21 · 604 阅读 · 0 评论 -
POJ 1459 Power Network DINIC
G - Power Network Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description A power network consists of nodes (power stations, consumers原创 2015-11-24 12:41:42 · 562 阅读 · 0 评论 -
POJ2516-Minimum Cost 最小费用最大流
H - Minimum Cost Time Limit:4000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description Dearboy, a goods victualer, now comes to a big problem, and he原创 2015-11-29 08:56:16 · 683 阅读 · 0 评论 -
poj 2195 - Going Home 二分图最优匹配 ek
I - Going Home Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description On a grid map there are n little men and n houses. In each unit原创 2015-11-29 09:00:19 · 496 阅读 · 0 评论 -
HDU 2066 dijkstra 最短路径
C - 一个人的旅行 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^)原创 2015-11-30 15:00:51 · 525 阅读 · 0 评论 -
HDU 4034 Graph floyd 最短路
H - Graph Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4034 Appoint description: System Crawler (2016-05-09) Description原创 2016-05-10 14:29:25 · 553 阅读 · 0 评论 -
sdut 2170 The Largest SCC
题意: 给出一个点数n≤1000 边数m≤20000 的有向图,一共Q≤20000 次询问,询问相互独立,每次询问如果将第x(1≤x≤m)条边变为无向边时,图中最大的强连通分量所包含的点数为多少 分析: 先缩点,如果加的边(a,b)本来就在同一个强连通内,那么答案就是原图的答案, 否则枚举a,b能到达的边,把他们所在的强连通累加就是答案 ACcode: #include #原创 2017-05-03 11:56:46 · 377 阅读 · 0 评论