上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 36 下一页
摘要: 想象一下,要搞掉一个植物,必须先搞掉另一些植物……我们可以发现这是一个最大权闭合子图的问题。 最大权闭合子图的话,太空飞行计划问题是一个入门题,可以一看。 然而我们手玩一下样例就会惊恐地发现,保护关系 出现了环 。 比如说: 从 i 到 j 的箭头是说要搞 i 就要先搞 j,这是为了和最大权闭合子图 阅读全文
posted @ 2018-01-16 16:39 poorpool 阅读(145) 评论(0) 推荐(0)
摘要: 其实,只用考虑某一行能否放到某一行就行了 cpp include include include using namespace std; int T, n, a[205][205], hea[405], cnt, ans, lnk[405]; bool vis[405]; struct Edge{ 阅读全文
posted @ 2018-01-16 08:29 poorpool 阅读(127) 评论(0) 推荐(0)
摘要: poorpool 真名 chenyixiao。是一条傻逼题都不会做的没有脑子的咸鱼。 现就读于华中科技大学计算机科学与技术学院,曾为山西省临汾第一中学校选手,NOIP 2017&2018 一等奖,WC 2018 无奖,SXOI 2018 暴力进队,APIO 2018 铜牌,THUSC 2018 未进 阅读全文
posted @ 2018-01-15 21:57 poorpool 阅读(796) 评论(3) 推荐(0)
摘要: 安装就把根节点到它全设为 1 删除就把以它为根的子树全设为 0 记得 标记初始化为 1 ,因为标记是 0 的情况也是要处理的。 阅读全文
posted @ 2018-01-15 21:10 poorpool 阅读(132) 评论(0) 推荐(0)
摘要: 二分图匹配,一边是属性值,一边是武器 cpp include include include using namespace std; int n, lst[1010005], uu, vv, hea[10005], cnt, ans; bool vis[1010005]; struct Edge{ 阅读全文
posted @ 2018-01-15 18:21 poorpool 阅读(93) 评论(0) 推荐(0)
摘要: 参考 "这里" 我们先预处理模数在 $\sqrt{n}$ 以内的询问。 要是模数在 $\sqrt{n}$ 以外,直接暴力统计,反正这样的数又不会超过 $\sqrt{n}$ 个。 修改的时候也是。要是在 $\sqrt{n}$ 以内就把预处理的答案减去原数加上新数。 然后再把原数改掉。 然后再优化一下, 阅读全文
posted @ 2018-01-15 16:46 poorpool 阅读(128) 评论(0) 推荐(0)
摘要: 先做一遍普通的dinic 然后再更改源点为超级源,超级源向原源加一条capacity=k && cost=0的边,再加上有费用的边跑最小费用最大流 cpp include include include include using namespace std; int n, m, k, ss, tt 阅读全文
posted @ 2018-01-15 15:53 poorpool 阅读(122) 评论(0) 推荐(0)
摘要: 把每个点拆成 x y z 对于第 i 个点,x y是表示流入的,y z是表示流出的。 cpp include include include include using namespace std; int n, m, ss, tt, hea[1305], cnt, minCost, pre[130 阅读全文
posted @ 2018-01-15 11:04 poorpool 阅读(137) 评论(0) 推荐(0)
摘要: 巨水,调了好久,心态爆炸 cpp include include include using namespace std; typedef long long ll; int n, m; const int mod=9999973; ll dp[105][105][105]; inline int 阅读全文
posted @ 2018-01-12 21:41 poorpool 阅读(130) 评论(0) 推荐(0)
摘要: num[x]表示x到达叶子最远路径。 每个子节点对答案的贡献是num[x] (num[t] + edge[i].val) cpp include include using namespace std; typedef long long ll; int n, ss, hea[500005], cn 阅读全文
posted @ 2018-01-12 20:13 poorpool 阅读(148) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 36 下一页