22684_Ray

2022-5-16 18:22| 发布者: Hocassian| 查看: 28| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506852130500-Problem List-采集的数据-后羿采集器.html

Pro.ID

22684

Title

Ray

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22684

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1500/500 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    There is a structure consisting of K homogenous slices of equal thickness. The refraction index of the i-th slice is Ni. A ray of light travels in the first slice at the angle a to the normal. Write a program to compute the angle that the ray will have to the normal in the last slice.

    It is known that the formula   Nsin= Nsinb   holds in a two-sliced structure with the refraction indices of the slices equal to N1 and N2, respectively, when a ray of light passes from the first slice to the second, traveling at the angle a to the normal in the first slice, and at the angle b to the normal in the second slice.

    输入

    On the first line of the file is the number of slices K ( 1 <= K <= 100 ). Each of the following K lines contains the refraction index Ni of the corresponding slice. All the refraction indices are real numbers in the range from 0.000001 to 2000. The last line of the file contains the angle a between the ray and the normal in the first slice. The angle is a real number in the range from 0 to p/2 and is given in radians.

    输出

    Description

    There is a structure consisting of K homogenous slices of equal thickness. The refraction index of the i-th slice is Ni. A ray of light travels in the first slice at the angle a to the normal. Write a program to compute the angle that the ray will have to the normal in the last slice.

    It is known that the formula   Nsin= Nsinb   holds in a two-sliced structure with the refraction indices of the slices equal to N1 and N2, respectively, when a ray of light passes from the first slice to the second, traveling at the angle a to the normal in the first slice, and at the angle b to the normal in the second slice.

    Input
    On the first line of the file is the number of slices K ( 1 <= K <= 100 ). Each of the following K lines contains the refraction index Ni of the corresponding slice. All the refraction indices are real numbers in the range from 0.000001 to 2000. The last line of the file contains the angle a between the ray and the normal in the first slice. The angle is a real number in the range from 0 to p/2 and is given in radians.
    Output
    The first and only line of the file must contain the angle b between the ray and the normal in the last slice. The answer must be given with the precision of 0.001. If the ray does not reach the last slice, the output must be the word ‘NO’.
    Sample Input
    2
    1
    2
    0.02
    Sample Output
    0.01
    Hint
    Special Judge
    Source

    样例输入

    2
    1
    2
    0.02

    样例输出

    0.01

    提示

    Special Judge


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部