![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分答案
文章平均质量分 60
Ren_Ivan
衡中oier,fight for furture
展开
-
bzoj 1189 紧急疏散 网络流
二分答案,网络流判断 将每个门拆点,每个人连向每个门的dis~当前解 然后跑最大流,如果等于人数,即为可行解 #include #include #include #include #include #include #define pa pair #define N 405 #define inf 0x7fffffff using namespace std; int n,m,p,per=原创 2017-07-29 21:20:52 · 556 阅读 · 0 评论 -
USACO JAN14 奶牛冰壶运动 凸包+判定
满足条件的一定是在凸包内的,直接判断 恬不知耻的加了特判,2333 #include #include #include #include #include #define N 50050 using namespace std; int n,ss[N],top,topa,topb,ans1,ans2; bool bo=0; struct point{ double x,y; }a[N],b原创 2017-08-08 07:44:18 · 510 阅读 · 0 评论 -
bzoj 2653 middle 二分答案 主席树判定
判断中位数是否可行需要将当前的解作为分界,大于其的置为1,小于为-1,然后b-c必选,ab,cd可不选,这个用线段树判定就好 但不能每次跑,所以套主席树,按权值排序,构建主席树,更新时将上一个节点改为-1,能保证以上结论 #include #include #include #include #include #define N 20005 using namespace std; int l原创 2017-08-05 11:46:20 · 264 阅读 · 0 评论 -
bzoj2326 [HNOI2011]数学作业
矩阵乘,按位搞 两个矩阵,分别为 ans00i00100\begin{matrix} ans & i & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{matrix} 10k11011001\begin{matrix} 10^k &0 & 0 \\ 1 & 1 & 0 \原创 2017-08-26 12:07:25 · 262 阅读 · 0 评论 -
[SCOI2005]栅栏 二分+dfs
这个题真的是太nb了,各种骚 二分答案,肯定要减最小的mid个,从大往小搜每一个木板,从大往小枚举所用的木材 当当前木材比最短的木板还短,就扔到垃圾堆里,并记录waste,当 waste+sum>tot 时,return #include #include #include #include #include #define N 2005 using namespace std; int n原创 2017-09-17 15:21:36 · 346 阅读 · 0 评论