2015年9月10日

CodeForces 540D Bad Luck Island 概率dp

摘要: CodeForces 540D应该是简单概率dp,由于写得少显得十分蠢萌求期望逆推,求概率正推,大概是这么个意思,贴一发留恋#include#include#includeusing namespace std;#define db doubleconst int maxn=108;db dp[ma... 阅读全文

posted @ 2015-09-10 22:29 此剑之势愈斩愈烈 阅读(126) 评论(0) 推荐(0) 编辑

hdu 1281 二分图残量增广

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1281每行每列最多放置一个车,所以可以把行号和列号当成点,给定的点当成边进行最大匹配,得到的答案就是最大放置数了然后,还要求重要点——转化为删除边后得到的最大匹配数是否发生变化的问题易知重要点一定是模型中产生最大匹... 阅读全文

posted @ 2015-09-10 21:27 此剑之势愈斩愈烈 阅读(155) 评论(0) 推荐(0) 编辑

2015年9月8日

hdu 2444判定二分图+最大匹配

摘要: 两连发板子题,水果留恋#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=208;struct shit{ int v,next;}edge[maxn*maxn>1); }... 阅读全文

posted @ 2015-09-08 21:27 此剑之势愈斩愈烈 阅读(120) 评论(0) 推荐(0) 编辑

2015年9月1日

hdu 3416 Marriage Match IV

摘要: 从城市A到B,每次都走最短路,但每条边最多走一次,能够走多少次曾做过一次这种题。建最短路树,跑SPFA值得注意的是,如果跑dij的时候不建立永久标号,会导致最短路树出错spfa要不停的进行松弛操作,同理不能这样建最短路树。看网上代码spfa都是正着反着跑两遍spfa,然后判断dis1[u]+dis2... 阅读全文

posted @ 2015-09-01 21:45 此剑之势愈斩愈烈 阅读(125) 评论(0) 推荐(0) 编辑

2015年8月26日

POJ 2516 Minimum Cost 最小费用流

摘要: 这题意恶心得我百度了。看小悠写的看懂的*_*各个商品的运输的代价计算是独立的,所以可以将他们分别处理#include#include#include#includeusing namespace std;const int INF=0x7f7f7f7f;const int maxn=100008;c... 阅读全文

posted @ 2015-08-26 20:58 此剑之势愈斩愈烈 阅读(161) 评论(0) 推荐(0) 编辑

2015年8月25日

CSU 1116 Kingdoms 最小生成树(prim)

摘要: 由于点数只有16,而点1又必选,暴力枚举选点情况,每次做一个最小生成树这里用的prim算法,要注意的是存在选取这些点但找不到生成树的情况,需要将之排出#include#include#include#include#includeusing namespace std;const int INF=0... 阅读全文

posted @ 2015-08-25 22:51 此剑之势愈斩愈烈 阅读(162) 评论(0) 推荐(0) 编辑

2015年8月24日

HDU 4280 Island Transport 又一发SAP

摘要: 终于有点SAP的感觉了。总结下模板#include#include#include#includeusing namespace std;const int maxn=100008;const int INF=0x7f7f7f7f;struct fuck{ int u,v,w,cap,next... 阅读全文

posted @ 2015-08-24 22:06 此剑之势愈斩愈烈 阅读(128) 评论(0) 推荐(0) 编辑

CSU Double Shortest Paths 湖南省第十届省赛

摘要: 第二道最小费用最大流,spfa+EK的组合比想象中快很多开始开边表为点的8倍,RE,不知道为什么#include#include#include#includeusing namespace std;const int maxn=508;const int INF=0x3f3f3f3f;struct... 阅读全文

posted @ 2015-08-24 00:00 此剑之势愈斩愈烈 阅读(127) 评论(0) 推荐(0) 编辑

2015年8月22日

hdu 5294 Tricks Device

摘要: 中规中矩的做法,第二发SAP。贴一发留恋。#include#include#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=2008;struct fuck{ int v,w;... 阅读全文

posted @ 2015-08-22 20:42 此剑之势愈斩愈烈 阅读(130) 评论(0) 推荐(0) 编辑

hdu 4294 第一发SAP

摘要: #include#include#include#includeusing namespace std;const int INF=0x7f7f7f7f;const int maxn=10008;struct fuck{ int u,v,flow,cap,next;}edge[maxn= '0... 阅读全文

posted @ 2015-08-22 13:55 此剑之势愈斩愈烈 阅读(127) 评论(0) 推荐(0) 编辑

导航