2018年6月23日

洛谷 2680 (NOIp2015) 运输计划

摘要: 题目:https://www.luogu.org/problemnew/show/P2680 因为是最长的时间最短,所以二分! 离线LCA可以知道路径长度。每次只看超过二分值的路径。 原本的想法是遍历一下每条超过二分值的路径,找出“去掉它就能使该路径合法”的那些边,打上标记,最后找到有k个标记的边就 阅读全文

posted @ 2018-06-23 19:53 Narh 阅读(139) 评论(0) 推荐(0) 编辑

bzoj 2763 [JLOI2011]飞行路线——分层图

摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2763 分层图两种方法的练习。 1.把图分成k+1层,本层去上面一层的边免费。但空间时间都不算优秀。 #include<iostream> #include<cstdio> #include<c 阅读全文

posted @ 2018-06-23 11:31 Narh 阅读(163) 评论(0) 推荐(0) 编辑

洛谷 2831 (NOIp2016) 愤怒的小鸟——仅+1所以bfs优化

摘要: 题目:https://www.luogu.org/problemnew/show/P2831 状压dp。跑得很慢。(n^2*2^n) 注意只打一只猪的情况。 #include<iostream> #include<cstdio> #include<cstring> #include<algorith 阅读全文

posted @ 2018-06-23 00:24 Narh 阅读(286) 评论(1) 推荐(0) 编辑

导航