分治&二分
G_rass
这个作者很懒,什么都没留下…
展开
-
poj 1905 Expanding Rods
DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls a原创 2015-07-20 17:43:24 · 343 阅读 · 0 评论 -
poj 2785 4 Values whose Sum is 0
DescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In t原创 2015-07-20 16:08:55 · 402 阅读 · 0 评论 -
集训队组队计划
Description 经过1个月的训练,集训工作组决定让大家组队参加组队赛。为了让每一队内部水平尽量平均,集训工作组希望能令每个队能力最强的队员和能力最弱的队员的能力值差值的最大值尽量小。已知每个队由三个人组成,一个人不能加入多个队伍,现在有N个队员,能力分别为a1,a2...an,要从中选出3M个队员组成M支队。请问这M支队伍中,能力差值的最大值最小为多少?I原创 2015-08-13 13:52:57 · 615 阅读 · 0 评论 -
hdu 1969 Pie
DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my par原创 2015-07-21 21:05:51 · 384 阅读 · 0 评论 -
hdu 2199 Can you solve this equation?
DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the input c原创 2015-07-21 20:55:54 · 566 阅读 · 0 评论 -
CodeForces 251A
题目链接题意:求三点相互间的距离不超过d的组合有多少种思路:遍历每一个点,向后查找距离d内点的集合个数 n ,sum+=n*(n-1)/2;查找时采用二分的方法(注意二分的一些小细节)#include#includetypedef long long ll;using namespace std;ll a[100005];ll n,d;ll find(ll b,ll原创 2015-07-23 09:49:23 · 484 阅读 · 0 评论 -
poj 2366 Sacrament of the sum
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatus Description— The Brother of mine, the Head of Monastic Order wants to know tomorrow about原创 2015-07-21 20:43:36 · 478 阅读 · 0 评论 -
poj 2104 Drying
题目链接题意:有一些衣服要晾干,你有一个吹风机可加快晾干速度,问最少多长时间思路:二分需要的时间,检查在需要的时间内没见衣服能否晾干,如不能晾干,则用吹风机,并计算使用吹风机的时间,(注意这里有几个坑),两种时间的比较作为二分的条件#include#include#include#includetypedef long long ll;using namespace原创 2015-07-23 11:21:30 · 471 阅读 · 0 评论