hdu5984
听说大佬都是看到1.693147就知道是ln(2)+1我是服气的
不过老老实实推的话就看你大一数分/高数是不是学扎实了
令
把L移到右边并两边求导可得
,即
令
代入最开始的公式得到
化简可得
,得解
#include<bits/stdc++.h> using namespace std; int main()
{
int cas;
scanf("%d",&cas);
while (cas--)
{
double l,d,ans=;
scanf("%lf%lf",&l,&d);
if (l>d) ans=log(l)-log(d)+;
printf("%.6lf\n",ans);
}
}
hdu5984的更多相关文章
- 【数学期望】hdu5984 Pocky
http://www.oyohyee.com/post/HDU/5984.html 看这篇吧,懒得写了. 训练时推得的式子有点鬼畜. #include<cstdio> #include&l ...
- hdu5984概率数学
转载 https://www.oyohyee.com/post/HDU/5984.html
- ACM/ICPC2016 青岛区域赛
A(hdu5982).(模拟) 题意:输入n对数,将每对数相乘并相加 分析:模拟 B(hdu5983).(模拟) 题意:给你一个二阶魔方,问能否通过一次旋转使得给定魔方的每个面颜色相同 分析:模拟 C ...
随机推荐
- struts2 - View页面中获取Action的成员变量
struts2 - View页面中获取Action的成员变量 2016年03月02日 11:04:44 IT男青年 阅读数:1074 View页面中获取Action的成员变量 按照Struts的设 ...
- php7实现基于openssl的加密解密方法
还需要注意的是加密字符串长度问题,如果加密字符串长度太长需要进行分段加解密,如下代码: 加密:(公匙加密,私密一般用来解密) function encrypt($originalData){ $pub ...
- svn常见错误
1.svn提交报错:svn: Aborting commit:XXXXXremains in conflict 解决:说明Svn服务器上的对应内容,在你上次Update后已被别人修改了,而你也做了修改 ...
- spring boot 2.0.3+spring cloud (Finchley)8、微服务监控Spring Boot Admin
参考:Spring Boot Admin 2.0 上手 Spring Boot Admin 用于管理和监控一个或多个Spring Boot程序,在 Spring Boot Actuator 的基础上提 ...
- PAT 1009. Triple Inversions (35) 数状数组
Given a list of N integers A1, A2, A3,...AN, there's a famous problem to count the number of inversi ...
- IDEA不显示更新、提交按钮
问题描述: IDEA右上角不显示版本管理的“更新”.“提交”等按钮,左侧代码树中,也没有文件的状态 解决办法: 点击VCS-->Enable Version Control Integratio ...
- [php]referer应用--http防盗链技术
1.防盗链的理解 所谓防盗链是防止其他的网站引用自己网站的资源连接,比如图片.视频等等,但是并不会阻碍从自己网站上享受资源的用户,这就要求能够将其他网站的连接请求阻止 2.防盗链的原理 其实从自己网站 ...
- LintCode 394: First Will Win
LintCode 394: First Will Win 题目描述 有n个硬币排成一条线.两个参赛者轮流从右边依次拿走1或2个硬币,直到没有硬币为止.拿到最后一枚硬币的人获胜. 请判定 第一个玩家 是 ...
- 【CodeForces】713 C. Sonya and Problem Wihtout a Legend
[题目]C. Sonya and Problem Wihtout a Legend [题意]给定n个数字,每次操作可以对一个数字±1,求最少操作次数使数列递增.n<=10^5. [算法]动态规划 ...
- CRF++进行中文分词实例
工具包:https://taku910.github.io/crfpp/#tips 语料:http://sighan.cs.uchicago.edu/bakeoff2005/ 安装: 1)下载linu ...