HDU 2438 (三分)
来源:互联网 发布:淘宝好的名牌原单店 编辑:程序博客网 时间:2024/06/05 04:33
不知道为什么要加特判才能过~~
#include <bits/stdc++.h>using namespace std;#define eps 1e-10#define pi acos (-1)double x, y, l, d;double f (double t) { return tan (t)*(-y) + l*sin (t) + d/(cos (t)) - x;}double solve () { double L = 0.0, R = pi/2.0, LL, RR; while (R-L > eps) { LL = (2*L+R)/3.0, RR = (2*R+L)/3.0; double p1 = f (LL), p2 = f (RR); if (p2 >= p1) { L = LL; } else R = RR; } return (L+R)/2.0;}int main () { //freopen ("in", "r", stdin); while (cin >> x >> y >> l >> d) { if (d > x || d > y) { printf ("no\n"); continue; } double ans = solve (); if (f (ans) <= eps) { printf ("yes\n"); } else printf ("no\n"); } return 0;}
0 0
- HDU 2438 三分
- HDU 2438 (三分)
- hdu-2438 计算几何+三分
- HDU 2438 求函数+三分
- hdu 2438+hdu 3400(三分求极值)
- hdu 3400-三分套三分
- HDOJ/HDU 2438 计算几何+三分
- HDU 2438——三分求值
- hdu 2438 - Turn the corner(三分)
- hdu 2438Turn the corner(三分)
- HDU 2438 Turn the corner(三分)
- hdu 2438 Turn the corner(三分)
- HDU 2438 Turn the corner(三分)
- hdu-2438-Turn the corner(三分)
- HDU 2438 Turn the corner 三分
- HDU 2438 Turn the corner【三分】
- HDU 2438 Turn the corner(三分)
- HDU 2438 Turn the corner 三分
- 高仿微信5.2.1主界面及消息提醒(fragment+viewPager+BadgeView)
- android hal学习——编写hal代码
- LeetCode -- Binary Tree Paths
- div模型
- strace调试(Linux Device Driver)
- HDU 2438 (三分)
- 个人主页
- 解决protobuf-lua导入其他proto的BUG
- LeetCode -- Bulls and Cows
- 获取TextView的高度
- MarkdownPad2如何使用空格
- 模拟输入H.264流,输出封装格式文件
- Libcap 文件格式
- LeetCode -- Game of Life