21742_HistoryofFootba

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

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

Pro.ID

21742

Title

History of Football

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    Henry is a historian. He specializes in the history of sports, especially football. Whenever he sees a table of a football tournament, he saves it into his database.

    Recently he ran across a web-site with standings of a small tournament. Unfortunately for him, the results of the games were lost, and the only available information was the amount of points gained by each team.

    Disappointed by that, he decides to have some mathematical fun and to calculate in how many different ways the games of the championship could have ended. He doesn't care about the scores of the games, he only cares about the winners.

    In that tournament the following rules were applied:

    • Each team plays against each other team exactly once.

    • In case of a tie each team gains 1 point.

    • In other case the winner gains 3 points and the loser gains 0 points.

    For example, if Henry knows that each of 3 teams had got 3 points by the end of the tournament, the answer to his question is that there are two possible tournament tables:

    Help Henry calculate the number of different possible tournament tables (without consideration of the scores of the games).

    输入

    Input file contains integer n, the number of teams in the championship (2 ≤ n ≤ 5). The following n lines contain one integer number each --- points gained by the teams.

    输出

    Description

    Henry is a historian. He specializes in the history of sports, especially football. Whenever he sees a table of a football tournament, he saves it into his database.

    Recently he ran across a web-site with standings of a small tournament. Unfortunately for him, the results of the games were lost, and the only available information was the amount of points gained by each team.

    Disappointed by that, he decides to have some mathematical fun and to calculate in how many different ways the games of the championship could have ended. He doesn't care about the scores of the games, he only cares about the winners.

    In that tournament the following rules were applied:

    • Each team plays against each other team exactly once.

    • In case of a tie each team gains 1 point.

    • In other case the winner gains 3 points and the loser gains 0 points.

    For example, if Henry knows that each of 3 teams had got 3 points by the end of the tournament, the answer to his question is that there are two possible tournament tables:

    Help Henry calculate the number of different possible tournament tables (without consideration of the scores of the games).

    Input

    Input file contains integer n, the number of teams in the championship (2 ≤ n ≤ 5). The following n lines contain one integer number each --- points gained by the teams.

    Output

    Output one integer number --- the number of possible tournament tables with given total points. It is guaranteed that there is at least one such tournament table.

    Sample Input

    3
    3
    3
    3

    Sample Output

    2

    Source

    样例输入

    3
    3
    3
    3

    样例输出

    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部