zoukankan      html  css  js  c++  java
  • PAT-1011 World Cup Betting 解答(with python)

    1.Description:

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money where their mouths were, by laying all manner of World Cup bets.

    Chinese Football Lottery provided a "Triple Winning" game. The rule of winning was simple: first select any three of the games. Then for each selected game, bet on one of the three possible results -- namely W for win, T for tie, and L for lose. There was an odd assigned to each result. The winner's odd would be the product of the three odds times 65%.

    2.Example:

    3.solutions:

     1 """
     2     created by sheepcore on 2020-03-01
     3 """
     4 
     5 def maxOdd(game):
     6     g1 = eval(game[0])
     7     g2 = eval(game[1])
     8     g3 = eval(game[2])
     9     if g1 >= g2 and g1 >= g3:
    10         return "W", g1
    11     if g2 >= g1 and g2 >= g3:
    12         return "T", g2
    13     if g3 >= g1 and g3 >= g2:
    14         return "L", g3
    15 
    16 if __name__ == "__main__":
    17     game1 = input().split()
    18     game2 = input().split()
    19     game3 = input().split()
    20     
    21     s1, odd1 = maxOdd(game1)
    22     s2, odd2 = maxOdd(game2)
    23     s3, odd3 = maxOdd(game3)
    24     odd = (odd1 * odd2 * odd3 * 0.65 - 1) * 2
    25     print(s1 + " " + s2 + " " + s3 + " ", end="")
    26     print("%.2f" %odd)
  • 相关阅读:
    web ERP前端技术选型
    poj1741 Tree 树的分治
    HDU4694 未AC
    zoj4100 Balanced Number 数位DP
    树的最小表示法 UVA 12489
    2013长沙网赛 I题 Grand Prix
    2013第八场多校
    2013第六场多校
    2013第五场多校
    ZOJ3724 树状数组+离线处理
  • 原文地址:https://www.cnblogs.com/sheepcore/p/12391610.html
Copyright © 2011-2022 走看看