#P3154. [CQOI2009] 循环赛
[CQOI2009] 循环赛
Description
teams play a round-robin: every pair of teams plays exactly once, and a draw gives , a win , and a loss points.
Given the teams’ final scores, find how many possible scoreboards there are.
平1胜3负0 means:
- If two teams draw, each receives point.
- Otherwise, the winner receives points, and the defeated team receives points.
Input Format
The first line contains a positive integer , the number of teams. The second line contains non-negative integers, the score of each team.
Output Format
Output a single line: the number of possible scoreboards. It is guaranteed that at least one possible scoreboard exists.
6
5 6 7 7 8 8
121
Hint
All testdata satisfy .
Translated by ChatGPT 5
京公网安备 11011102002149号