摘要: 题目传送门 1 /* 2 二分搜索:搜索安排最近牛的距离不小于d 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 9 const int MAXN = 1e5 + 10;10 const int INF ... 阅读全文
posted @ 2015-07-25 18:52 Running_Time 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:求费马点 3 三分:对x轴和y轴求极值,使到每个点的距离和最小 4 */ 5 #include 6 #include 7 #include 8 #include 9 10 const int MAXN = 1e2 + 10;11 const i... 阅读全文
posted @ 2015-07-25 18:50 Running_Time 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 二分:搜索距离,判断时距离小于d的石头拿掉 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 typedef long long ll;11 const... 阅读全文
posted @ 2015-07-25 18:46 Running_Time 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:分成m个集合,使最大的集合值(求和)最小 3 二分搜索:二分集合大小,判断能否有m个集合。 4 */ 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11... 阅读全文
posted @ 2015-07-25 18:43 Running_Time 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:n条绳子问切割k条长度相等的最长长度 3 二分搜索:搜索长度,判断能否有k条长度相等的绳子 4 */ 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11... 阅读全文
posted @ 2015-07-25 18:38 Running_Time 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:有n个点,用相同的线段去覆盖,当点在线段的端点才行,还有线段之间不相交 3 枚举+贪心:有坑点是两个点在同时一条线段的两个端点上,枚举两点之间的距离或者距离一半,尽量往左边放,否则往右边放, 4 判断一下,取最大值。这题... 阅读全文
posted @ 2015-07-25 18:34 Running_Time 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 三分:凹(凸)函数求极值 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const int MAXN = 1e4 + 10;11 const int ... 阅读全文
posted @ 2015-07-25 18:27 Running_Time 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 二分搜索:式子两边取对数,将x提出来,那么另一边就是一个常数了,函数是:lnx/x。二分搜索x,注意要两次 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 9 const dou... 阅读全文
posted @ 2015-07-25 18:23 Running_Time 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 二分搜索:枚举高度,计算体积与给出的比较。 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const int MAXN = 1e3 + 10;11 ... 阅读全文
posted @ 2015-07-25 18:16 Running_Time 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:给出一个数,问是否有ai + bj + ck == x 3 二分查找:首先计算sum[l] = a[i] + b[j],对于q,枚举ck,查找是否有sum + ck == x 4 */ 5 #include 6 #include 7 #incl... 阅读全文
posted @ 2015-07-25 18:12 Running_Time 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 1 /* 2 题意:一个汉堡制作由字符串得出,自己有一些原材料,还有钱可以去商店购买原材料,问最多能做几个汉堡 3 二分:二分汉堡个数,判断此时所花费的钱是否在规定以内 4 */ 5 #include 6 #include 7 #include 8 using na... 阅读全文
posted @ 2015-07-25 18:07 Running_Time 阅读(242) 评论(0) 推荐(0) 编辑