POJ 3104 Drying (二分+精度)】的更多相关文章

题目链接:click here~~ [题目大意]: 题意:有一些衣服,每件衣服有一定水量,有一个烘干机,每次能够烘一件衣服,每分钟能够烘掉k单位水. 每件衣服没分钟能够自己主动蒸发掉一单位水, 用烘干机烘衣服时不蒸发.问最少须要多少时间能烘干全部的衣服. [解题思路]: 题目数据较大.常规方法肯定会TE.首先能够想到二分枚举答案.枚举时间mid值,(一般二分的题目,题目叫你求什么,就二分什么就能够了) 那么相应两种方法 1:自然风干.2:吹风机吹干 若一件衣服的水量小于mid,则自然风干就可以,…
题目链接:http://poj.org/problem?id=3104                                                                                                      Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 11128   Accepted: 2865 Description It is very…
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…
传送门 表示又是神题一道 Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9327   Accepted: 2364 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 proces…
[题目链接] http://poj.org/problem?id=3104 [题目大意] 给出n件需要干燥的衣服,烘干机能够每秒干燥k水分, 不在烘干的衣服本身每秒能干燥1水分 求出最少需要干燥的时间. [题解] 考虑将烘干机的烘干效应变为k-1,那么就是每件衣服在每秒都会自动减少一水分 如果我们知道最少需要的时间,那么每件衣服自己减少的水分数量就知道了, 在除去自然减少的水分之后,看看还需要多少k-1的水分减少才能烘干全部的衣服就可以了, 因此我们二分这个答案,验证是否可行即可. [代码] #…
题目链接: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…
Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 22163   Accepted: 5611 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…
<题目链接> 题目大意: 有一些衣服,每件衣服有一定水量,有一个烘干机,每次可以烘一件衣服,每分钟可以烘掉k滴水.每件衣服没分钟可以自动蒸发掉一滴水,用烘干机烘衣服时不蒸发.问最少需要多少时间能烘干所有的衣服. 解题分析: 本题用二分答案求解,解题思路就是二分时间,再对每个物品依据当前二分的时间进行判断,如果该物品水量小于等于总时间,那么就等其自然风干即可,如果大于总时间,那么要使当前枚举的答案成立,该衣服必然要消耗一定的机器清洗时间,算出所有衣服需要消耗的时间,将其与枚举的答案比较,即可判断…
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…
Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7684   Accepted: 1967 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 d…