题意:n件衣服各含有ai水分,自然干一分钟一个单位,放烘干机一分钟k个单位,问:最短时间? 思路: mid为最短时间 如果 a[i]-mid>0说明需要放入烘干机去烘干 烘干的时间为x  那么满足  kx+(mid-x)>=a[i]  可以推出  x=(a[i]-mid)/(k-1),记住要向上取余 把所有需要烘干机烘干的时间都加起来 ans. 如果ans>mid 说明mid太小 增加下限  反之减少上限 刚开始下限为 1,上限为 max 如果k==1 则结果为 max 解决问题的代码:…
题目链接:http://poj.org/problem?id=3104                                                                                                      Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 11128   Accepted: 2865 Description It is very…
题目 这道题做了几个小时了都没有做出来,首先是题意搞了半天都没有弄懂,难道真的是因为我不打游戏所以连题都读不懂了? 反正今天是弄不懂了,过几天再来看看... 题意:一个人从1点出发到T点去打boss,这个人有两个属性值,防御值和战斗值,这两个值成反比,为了打赢boss我们要使战斗值最大,于是乎防御值就要最低,但是也不能太低,于是乎这个界限在哪,这就是我们要求的.每条路上都有一个索敌值,防御值必须>=索敌值 才能通过.从1点到T点有很多条通路,我们要找的是:这每一条通路中索敌值最大的中索敌值最小的…
Description It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But the radiator is small, so it can hold…
Description Farmer John ≤ moneyi ≤ ,) that he will need to spend each day over the next N ( ≤ N ≤ ,) days. FJ wants to create a budget ≤ M ≤ N) fiscal periods called or more consecutive days. Every day is contained in exactly one fajomonth. FJ's goal…
Description Farmer John has built a <= N <= ,) stalls. The stalls are located along a straight line at positions x1,...,xN ( <= xi <= ,,,). His C ( <= C <= N) cows don't like this barn layout and become aggressive towards each other once…
Description Every year the cows hold an ≤ L ≤ ,,,). Along the river between the starting and ending rocks, N ( ≤ N ≤ ,) more rocks appear, each at an integral distance Di < Di < L). To play the game, each cow in turn starts at the starting rock and…
http://poj.org/problem?id=3104 题目大意: 有n件衣服,每件有ai的水,自然风干每分钟少1,而烘干每分钟少k.求所有弄干的最短时间. 思路: 注意烘干时候没有自然风干. 能够理解为烘干时每分钟掉(k-1)的水. 这样每件衣服每分钟就都掉1水了. 二分枚举最小值就可以. #include<cstdio> #include<algorithm> using namespace std; const int MAXN=100000+10; int a[MAX…
题目链接:http://poj.org/problem?id=3104 Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9440   Accepted: 2407 Description It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afrai…
[题目链接] http://poj.org/problem?id=3104 [题目大意] 给出n件需要干燥的衣服,烘干机能够每秒干燥k水分, 不在烘干的衣服本身每秒能干燥1水分 求出最少需要干燥的时间. [题解] 考虑将烘干机的烘干效应变为k-1,那么就是每件衣服在每秒都会自动减少一水分 如果我们知道最少需要的时间,那么每件衣服自己减少的水分数量就知道了, 在除去自然减少的水分之后,看看还需要多少k-1的水分减少才能烘干全部的衣服就可以了, 因此我们二分这个答案,验证是否可行即可. [代码] #…