
求解策略:二分
文章平均质量分 79
论菜鸟的自我修养
凡事不能将我们毁灭,必使我们更强大
展开
-
POJ 3111 K Best <最大化平均,二分>
传送门:http://poj.org/problem?id=3111 题意:给你n个物品的重量和价值wi和vi。从中选出k个物品使得单位重量最大,输出序号 分析:最大化平均+二分 这是一道很经典的问题。。。 ac代码: #include #include #include using namespace std; #define LL long lo原创 2016-08-08 22:13:09 · 364 阅读 · 0 评论 -
UVALIVE 3525 Wild West <分类枚举 + 二分优化>
传送门:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1526 题意: 每个人有三种属性(a,b,c),1 数据范围:1<=N<=10^5,2<=M<=10^5 分析:枚举,set优化 求M^3个组合中有多原创 2016-08-10 16:03:40 · 644 阅读 · 0 评论 -
UVALIVE 3177 Beijing Guards
传送门:UVALIVE 3177 #include #include #include #include #include using namespace std; const int maxn = 100000; int a[maxn],b[maxn],c[maxn]; int n; int solve(int p) { int x = a[0],y = p-a[0]; b[原创 2016-09-06 15:46:30 · 333 阅读 · 0 评论