Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktoptournament · ordering · optimization
The organizer’s problem statement is available at the official source link.
tournament ordering
Minimize coins by choosing the presentation order
Every pair fights once. A wins when sA + rA*sB exceeds sB + rB*sA. A wrestler earns one coin per win, plus one for each defeated wrestler presented earlier.
| Matchup | A index | B index |
|---|---|---|
| A vs B | sA + rA * sB | sB + rB * sA |
| presentation order | wins + earlier defeated wrestlers | maximize/compute coin awards |
- 1
Resolve each match
For wrestlers A and B, compare sA + rA*sB with sB + rB*sA. - 2
Count awards for an order
Each win earns one coin; an earlier presentation of a defeated wrestler adds one more coin. - 3
Minimize the total
Choose a presentation sequence that minimizes the total coins awarded.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.