CSU 1712--Refract Facts
来源:互联网 发布:白金数据 东野圭吾 编辑:程序博客网 时间:2024/06/15 13:25
思路:在 0--90 之内二分角 1 ,得到结果的余角即为答案。
代码如下:
#include <iostream>#include <cstring>#include <cstdio>#include <cmath>#include <algorithm>using namespace std;#define pi 3.1415926#define eps 1e-6int main(){#ifdef OFFLINEfreopen("t.txt", "r", stdin);#endifdouble h, d, x, n1, n2;while (~scanf("%lf%lf%lf%lf%lf", &d, &h, &x, &n1, &n2)){if (!h&&!d&&!x&&!n1&&!n2) break;double mid, l = 0, r = 90, cta1, cta2;//二分cta1(角1)while (l + eps <= r){mid = (l + r) / 2;cta1 = mid / 180 * pi;cta2 = asin(sin(cta1)*n2 / n1);if (d*tan(cta1) + h*tan(cta2) <= x)l = mid;elser = mid;}printf("%.2lf\n", 90 - r);}return 0;}
0 0
- CSU 1712--Refract Facts
- csuoj-1712-Refract Facts
- 二分 csu1712 Refract Facts
- 湖南省多校对抗赛 Refract Facts
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- CSU
- mini2440基于boa服务器通过WEB控制GPIO
- Java高级部分之线程重点总结(下)
- free命令
- C++虚函数表小记
- 面向过程到面向对象-入门,心得(实例剖析)
- CSU 1712--Refract Facts
- 全版本Genymotion模拟器创建过程所需的.ova文件下载地址说明
- python中的装饰器@staticmethod和@classmethod
- 浅析ltp测试流程
- 理解支持向量机(四)LibSVM工具包的使用
- hdu4123(树的直径+ST算法)
- UITableView的介绍及使用
- bzoj 1477: 青蛙的约会
- 移植mjpg-streamer