08 2019 档案

摘要:http://codeforces.com/gym/102222/problem/F fory #include<bits/stdc++.h> using namespace std; typedef long long ll; #define lson root<<1,l,midd #define 阅读全文
posted @ 2019-08-31 15:05 starve_to_death 阅读(260) 评论(0) 推荐(0)
摘要:简单的树链剖分+线段树 #include<bits\stdc++.h> using namespace std; #define pb push_back #define lson root<<1,l,midd #define rson root<<1|1,midd+1,r const int M= 阅读全文
posted @ 2019-08-30 09:11 starve_to_death 阅读(151) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5452 题意:给个图T(图G的最小生成树),然后再给定图G的剩余边,问你从图T中当且割一条边的情况再割图G中不属于图T的边,使整个图(图G)不联通,求最小割; 分析:1、只能并且要求割图T中的一条边,所以只能割叶子 阅读全文
posted @ 2019-08-29 11:31 starve_to_death 阅读(139) 评论(1) 推荐(0)
摘要:学习粗:https://blog.csdn.net/creatorx/article/details/75446472 主要解决 可查询历史版本的线段树,区间第k大问题 我们询问【L,R】时,我们就认为是第R棵树减去第L-1棵树;(详情:https://blog.csdn.net/bestFy/ar 阅读全文
posted @ 2019-08-26 22:26 starve_to_death 阅读(227) 评论(0) 推荐(0)
摘要:04 http://acm.hdu.edu.cn/showproblem.php?pid=6705 分析;先把每条边以 形式放进堆,堆按路径权值从小到大排序,然后每次取出堆顶,用v的出边扩展 新的路径。但是一个点的出度可能会非常大(如菊花图),可以发现,将出边排序之后, 每次只需要扩 展当前点最小的 阅读全文
posted @ 2019-08-24 00:03 starve_to_death 阅读(116) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/890/F 题意:二维平面中有n个气球,你可以横着社三法子弹,竖着射三发子弹,且横着子弹的关系是y,y+r,y+2*r,竖着是x,x+r,x+2*r。问你怎么射才能射爆最多的气球。 分析:(代码注释) #include<bits 阅读全文
posted @ 2019-08-19 14:42 starve_to_death 阅读(202) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/887/E 树状数组做法(代码有注释) #include<bits/stdc++.h> using namespace std; typedef long long ll; const int M=4e5+5; int x[M] 阅读全文
posted @ 2019-08-19 11:46 starve_to_death 阅读(146) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/889/D(超大背包) #include<bits/stdc++.h> using namespace std; //__ #define pb push_back typedef long long ll; typedef u 阅读全文
posted @ 2019-08-15 19:40 starve_to_death 阅读(168) 评论(0) 推荐(0)
摘要:题意:有n种树,给出每种数的高度、移除的花费和数量,求最小花费是多少使得剩下树中最高的树的数量占一半以上。 分析:以高度排序,枚举每一高度,对当前枚举到的这个高度视为最高高度,数目由num棵,然后后面肯定要砍掉因为比他高,然后再考虑比他小的,因为要构成俩倍的关系,所以最多保留num-1棵。 #inc 阅读全文
posted @ 2019-08-10 05:33 starve_to_death 阅读(743) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3228 题意:就是图上有n个点,m条边,题目给的俩个长度为n的序列,第一个是表示i位置的宝藏的体积V,第二个序列是表示i位置能容纳的宝藏体积V。然后给出m条边和权值。最终要问把这些宝藏全部放置在仓库所要走的路径中哪一条边最大(要这个最大值尽可能小 阅读全文
posted @ 2019-08-06 21:20 starve_to_death 阅读(165) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3723 题意:给定n个男生和m个女生的关系,各个关系具有一定的权值,然后要挑选出所有人,每个人的代价是10000,但挑选人的过程中这些权值就是可以用来减去费用,求cost的min #include<cstdio> #include<string> 阅读全文
posted @ 2019-08-05 17:05 starve_to_death 阅读(483) 评论(0) 推荐(0)