题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=83008#problem/E

Description

HINT

题意:

给你一个水池,水池中放一个东西,上面一双眼睛,问眼睛能看到东西时,水面的最小高度

题解:

列列方程就是了

  1. #include <cstdio>
  2. #include <cmath>
  3. #include <cstring>
  4. #include <ctime>
  5. #include <iostream>
  6. #include <algorithm>
  7. #include <set>
  8. #include <vector>
  9. #include <sstream>
  10. #include <queue>
  11. #include <typeinfo>
  12. #include <fstream>
  13. #include <map>
  14. #include <stack>
  15. typedef long long ll;
  16. using namespace std;
  17. //freopen("D.in","r",stdin);
  18. //freopen("D.out","w",stdout);
  19. #define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
  20. #define test freopen("test.txt","r",stdin)
  21. #define maxn 2000001
  22. #define mod 1000000007
  23. #define eps 1e-9
  24. const int inf=0x3f3f3f3f;
  25. const ll infll = 0x3f3f3f3f3f3f3f3fLL;
  26. inline ll read()
  27. {
  28. ll x=,f=;char ch=getchar();
  29. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  30. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  31. return x*f;
  32. }
  33. //**************************************************************************************
  34.  
  35. double w,h,x,xe,ye,p;
  36.  
  37. int main()
  38. {
  39. int t=read();
  40. while(t--)
  41. {
  42. cin>>w>>h>>x>>xe>>ye>>p;
  43. double tan1=(xe-w)/(ye-h);
  44. double tan2=tan(asin(sin(atan(tan1))/p));
  45.  
  46. double x1=w-tan1*h;
  47. double ans=(x-x1)/(tan1-tan2);
  48. if(ans<=)
  49. cout<<"0.0000"<<endl;
  50. else if(ans>h)
  51. cout<<"Impossible"<<endl;
  52. else
  53. printf("%.4f\n",ans);
  54. }
  55. }

UVA 12901 Refraction 数学的更多相关文章

  1. UVA 12901 Refraction 几何/大雾题

    Refraction Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.a ...

  2. UVA 12901 Refraction 折射 (物理)

    一道物理题,解个2次方程就行了... 求h最小的情况对应如下图所示 做法不唯一,我想避免精度损失所以在化简的时候尽可能地去避免sqrt和浮点数乘除. 似乎精度要求很低,直接用角度算也可以 #inclu ...

  3. UVA 10089 Repackaging 数学问题

    大致题意:给出几个包裹,每个包裹都包装好了3种大小的杯子.现在要重新包装,使向量 a[1]*(s[1][1],s[1][2],s[1][3])+a[2]*(s[2][1],s[2][2],s[2][3 ...

  4. 紫书 例题 10-16 UVa 12230(数学期望)

    感觉数学期望的和化学里面求元素的相对原子质量的算法是一样的 就是同位素的含量乘上质量然后求和得出 这道题因为等待时机是0到2*l/v均匀分配的,所以平均时间就是l/v 再加上过河的l/v, 最后加上步 ...

  5. UVa 10323 【数学】

    UVa 10323 题目:计算阶乘在10000~6227020800之间的值,不在范围对应输出Under或者Over. 分析:简单题.数论.因为13!=6227020800,7!<10000&l ...

  6. UVa第十章数学概念与方法

    Bryce1010模板 10.1数论初步 1.欧几里得算法和唯一分解定理 2.Eratosthenes筛法 补充素数筛选 const int MAXN=1e6+10; ll prime[MAXN]; ...

  7. UVA 10025(数学)

     The ? 1 ? 2 ? ... ? n = k problem  The problem Given the following formula, one can set operators ' ...

  8. UVA 11346 - Probability 数学积分

    Consider rectangular coordinate system and point L(X, Y ) which is randomly chosen among all pointsi ...

  9. UVA 11971 - Polygon 数学概率

                                        Polygon  John has been given a segment of lenght N, however he n ...

随机推荐

  1. robotFramework——截屏

    测试执行过程中进行截屏并且保存,是任何一款自动化测试工具或者框架必备的功能.那么Robotframework如何进行截屏呢?Robotframework提供了一个“Screenshot”库.    使 ...

  2. ios NSURLSession completeHandler默认调用quque

    注意 , [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSU ...

  3. ZPF MYSQL数据库链接层

    2015年3月31日 18:27:34 最后编辑: 2016年4月17日 00:22:00 星期日 读写分离: 根据最终的sql语句来判断是读还是写  (随后会考察并加上一致性哈希) 链式调用: 参看 ...

  4. selenium 配合sikuli script操作高德地图

    会不会使用工具,是一般QA和高级QA的区别 ---To be crazy Java就是好,开源框架遍地都是,各种niubility的jar包,各种神器,真是不亦乐乎. 今天研究一下基于图片识别作为对象 ...

  5. 数据库SQL语句

    增删改查 --增加 create INSERT INTO table_name (列1, 列2,...) VALUES (值1, 值2,....) --删除 delete DELETE FROM 表名 ...

  6. HDU 2602 Bone Collector WA谁来帮忙找找错

    Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collec ...

  7. monitor disk

    #!/bin/bash # #top #Big_USERS - find big disk space users in various directories ################### ...

  8. Xcode无法启动ios模拟器的问题

    一.问题描述 开发过程需要来回切换ios模拟器调试程序,开始在iPhone 4s下调试,然后切换到iPhone 6s Plus,再切换回iPhone 4s,遇到无法启动ios模拟器.错误提示如下: 二 ...

  9. linq lanbda表达式的用法

    1. 查询Student表中的所有记录的Sname.Ssex和Class列.select sname,ssex,class from studentLinq:    from s in Student ...

  10. 【mysql】Blob类型

    来源:http://qgyang.blog.sohu.com/115847378.html 一般在需要存储较大数据时使用Bolb MySql的Bolb四种类型 MySQL中,BLOB是一个二进制大型对 ...