上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页
摘要: 题意:有n种树,给出每种数的高度、移除的花费和数量,求最小花费是多少使得剩下树中最高的树的数量占一半以上。 分析:以高度排序,枚举每一高度,对当前枚举到的这个高度视为最高高度,数目由num棵,然后后面肯定要砍掉因为比他高,然后再考虑比他小的,因为要构成俩倍的关系,所以最多保留num-1棵。 #inc 阅读全文
posted @ 2019-08-10 05:33 starve_to_death 阅读(726) 评论(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 阅读(157) 评论(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 阅读(471) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/mountaink/p/9878918.html 分析:每次的选取必须选最优的一条链,那我们考虑一下选择这条链后,把这条路上的点的权值更新掉,再采取选最优的一条链的策略,如此往复。 所以考虑利用dfs序来处理线段树,线段树维护的是最最优链的值,已经这条 阅读全文
posted @ 2019-07-19 16:07 starve_to_death 阅读(174) 评论(0) 推荐(0) 编辑
摘要: A题 线段树可卡时限过 (1500MS) #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf=0x3f3f3f3f; const int M=1e5+5; int a[M],b[M],mpa 阅读全文
posted @ 2019-07-19 08:54 starve_to_death 阅读(230) 评论(0) 推荐(0) 编辑
摘要: http://codevs.cn/problem/2370/ #include<bits/stdc++.h> using namespace std; const int M=5e4+5; const int N=20; struct node{ int v,w; node(int vv=0,int 阅读全文
posted @ 2019-07-17 14:40 starve_to_death 阅读(120) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=867 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #inc 阅读全文
posted @ 2019-07-16 19:01 starve_to_death 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 洛谷2661 https://www.luogu.org/problemnew/show/P2661 分析:求缩点后成环中,环大小最小的size #include<bits/stdc++.h> using namespace std; const int M=2e5+5; vector<int>e[ 阅读全文
posted @ 2019-07-16 08:38 starve_to_death 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 学习:https://www.cnblogs.com/lcf-2000/p/5866170.html 题目:http://codevs.cn/problem/1082/ #include<iostream> #include<cstring> #include<cstdio> #include<al 阅读全文
posted @ 2019-07-14 21:54 starve_to_death 阅读(109) 评论(0) 推荐(0) 编辑
摘要: hdu2642 http://acm.hdu.edu.cn/showproblem.php?pid=2642 题目大意: 现在假设天空是一个二维平面(1000*1000)。坐标从(0,0)点开始。现在给出N条信息。 "B X Y",B为字符,x、y是整数,表示将坐标(x,y)的星星变亮。 "D XY 阅读全文
posted @ 2019-07-14 10:00 starve_to_death 阅读(255) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页