21839_ssworldVSDDD

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

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

Pro.ID

21839

Title

ssworld VS DDD

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    One day, sssworld and DDD play games together, but there are some special rules in this games.

    They both have their own HP. Each round they dice respectively and get the points P1 and P2 ( 1 ≤ P1, P2 ≤ 6 ). Small number who, whose HP to reduce 1, the same points will remain unchanged. If one of them becomes 0 HP, he loses.

    As a result of technical differences between the two, each person has different probability of throwing 1, 2, 3, 4, 5, 6. So we couldn't predict who the final winner.

    输入

    There are multiple test cases.

    For each case, the first line are two integer HP1, HP2 ( 1 ≤ HP1, HP2 ≤ 2000 ), said the first player sssworld's HP and the second player DDD's HP.

    The next two lines each have six floating-point numbers per line. The j-th number on the i-th line means the the probability of the i-th player gets point j. The input data ensures that the game always has an end.

    输出

    Description

    One day, sssworld and DDD play games together, but there are some special rules in this games.

    They both have their own HP. Each round they dice respectively and get the points P1 and P2 ( 1 ≤ P1, P2 ≤ 6 ). Small number who, whose HP to reduce 1, the same points will remain unchanged. If one of them becomes 0 HP, he loses.

    As a result of technical differences between the two, each person has different probability of throwing 1, 2, 3, 4, 5, 6. So we couldn't predict who the final winner.

    Input

    There are multiple test cases.

    For each case, the first line are two integer HP1, HP2 ( 1 ≤ HP1, HP2 ≤ 2000 ), said the first player sssworld's HP and the second player DDD's HP.

    The next two lines each have six floating-point numbers per line. The j-th number on the i-th line means the the probability of the i-th player gets point j. The input data ensures that the game always has an end.

    Output

    One float with six digits after point, indicate the probability sssworld won the game.

    Sample Input

    5 5
    1.000 0.000 0.000 0.000 0.000 0.000
    0.000 0.000 0.000 0.000 0.000 1.000
    5 5
    0.000 0.000 0.000 0.000 0.000 1.000
    1.000 0.000 0.000 0.000 0.000 0.000

    Sample Output

    0.000000
    1.000000

    Source

    样例输入

    5 5
    1.000 0.000 0.000 0.000 0.000 0.000
    0.000 0.000 0.000 0.000 0.000 1.000
    5 5
    0.000 0.000 0.000 0.000 0.000 1.000
    1.000 0.000 0.000 0.000 0.000 0.000

    样例输出

    0.000000
    1.000000

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部