二分答案

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n,l,v1,v2,k;
double judge(double mid){//在mid时间内走完
if(mid*v2<l)return ;
double t=mid-(v2*mid-l)/(v2-v1);//每人坐车t分钟
double rt=t*(v2-v1)/(v1+v2);//回去的时间
int num=n/k;//送的批数
if(n%k)num++;
double tot=num*t+(num-)*rt;
if(tot<mid)return ;
return ;
} int main(){
cin>>n>>l>>v1>>v2>>k;
double L=,R=1e10,ans,mid;
while(R-L>1e-){
mid=(L+R)/;
if(judge(mid))
ans=mid,R=mid;
else L=mid;
}
printf("%.10lf\n",ans);
}

数学二分——cf700A的更多相关文章

  1. HDU 6216 A Cubic number and A Cubic Number(数学/二分查找)

    题意: 给定一个素数p(p <= 1e12),问是否存在一对立方差等于p. 分析: 根据平方差公式: 因为p是一个素数, 所以只能拆分成 1*p, 所以 a-b = 1. 然后代入a = b + ...

  2. UVA 10668 - Expanding Rods(数学+二分)

    UVA 10668 - Expanding Rods 题目链接 题意:给定一个铁棒,如图中加热会变成一段圆弧,长度为L′=(1+nc)l,问这时和原来位置的高度之差 思路:画一下图能够非常easy推出 ...

  3. Success Rate CodeForces - 807C (数学+二分)

    You are an experienced Codeforces user. Today you found out that during your activity on Codeforces ...

  4. CF 483B. Friends and Presents 数学 (二分) 难度:1

    B. Friends and Presents time limit per test 1 second memory limit per test 256 megabytes input stand ...

  5. HDU 5646 DZY Loves Partition 数学 二分

    DZY Loves Partition 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5646 Description DZY loves parti ...

  6. UVA 11881 Internal Rate of Return(数学+二分)

    In finance, Internal Rate of Return (IRR) is the discount rate of an investment when NPV equals zero ...

  7. AtCoder Express(数学+二分)

    D - AtCoder Express Time limit : 2sec / Memory limit : 256MB Score : 400 points Problem Statement In ...

  8. ACM学习历程—HDU5587 Array(数学 && 二分 && 记忆化 || 数位DP)(BestCoder Round #64 (div.2) 1003)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5587 题目大意就是初始有一个1,然后每次操作都是先在序列后面添加一个0,然后把原序列添加到0后面,然后 ...

  9. Codeforces Round #364 (Div. 2) D. As Fast As Possible 数学二分

    D. As Fast As Possible 参考:https://blog.csdn.net/keyboardmagician/article/details/52769493 题意: 一群大佬要走 ...

随机推荐

  1. loadRunner函数之web_find

    int web_find( const char *StepName, <Attributes and Specifications list>, char *searchstring, ...

  2. SSD接口详解,再也不会买错固态硬盘了

    http://stor.51cto.com/art/201808/582349.htm 硬盘知识科普中,我们提到了SSD的发展史虽短,但是种类和协议比HDD不知道多到哪里去了.因此,本期小编就通过接口 ...

  3. [CSP-S模拟测试45]题解

    开局一行$srand$,得分全靠随机化. A.kill 发现两个并不显然的性质: 1.选中的人和怪物一定是按顺序的.第一个人打所有被选中怪物的第一只,第二个人打第二只,$etc$. 2.最优方案打的怪 ...

  4. (转)Maven中的库(repository)详解 ---repository配置查找构件(如.jar)的远程库

    转:https://blog.csdn.net/taiyangdao/article/details/52287856 Maven中的库(repository)是构件(artifact)的集合.构件以 ...

  5. JAVA Web学习笔记

    JAVA Web学习笔记 1.JSP (java服务器页面) 锁定 本词条由“科普中国”百科科学词条编写与应用工作项目 审核 . JSP全名为Java Server Pages,中文名叫java服务器 ...

  6. 本地安装了flash,前台浏览器还显示需要安装flash?是因为版本需要对应

    NPAPI:适用于FireFox(火狐).Safari(苹果).Opera (欧朋,12.17版以下) PPAPI:适用于Chromium浏览器.Opera (欧朋,15.00版以上) ActiveX ...

  7. Windows 08 R2_NLB负载均衡(图文详解)

    目录 目录 Load Balance 使用NLB来部署Web Farm集群 环境准备 在Win08r2pc1中配置DNS服务 在Win08r2pc1中部署File Service文件服务 在Win08 ...

  8. idea 查看字节码 bytecode插件 (jclasslib Bytecode Viewer、ASM Bytecode Viewer )

    文章目录 jclasslib Bytecode Viewer ASM Bytecode Viewer jclasslib Bytecode Viewer 然后重启idea===>重新编译(构建项 ...

  9. 【转】JMX之ObjectName

    原文链接:https://blog.csdn.net/yunlong34574/article/details/46563187 ObjectName 就是存储了一个domain(域)下的一些属性,属 ...

  10. 使用element-ui 组件动态合并table的行/列(第二次修改)

    这是第二次修改,在通过调用后台接口返回来的时候,发现了代码中的问题:现在将博客中错误的地方改过来,添加备注 文章需求:动态实现table表格中行/列的自动合并 使用框架及UI类库:Vue+Elemen ...