Loading problem...
A football competition stores roster and match data in two relational tables.
Teams table:
Matches table:
Scoring rules:
Task:
Output requirements:
Supported submission environments:
teams:
| team_id | team_name |
|---------|------------------|
| 10 | Leaders FC |
| 20 | Harbor United |
| 30 | Capital Athletic |
| 40 | Midtown City |
| 50 | Lakeside Rovers |
matches:
| match_id | host_team | guest_team | host_goals | guest_goals |
|----------|-----------|------------|------------|-------------|
| 1 | 10 | 20 | 3 | 0 |
| 2 | 30 | 10 | 2 | 2 |
| 3 | 10 | 50 | 5 | 1 |
| 4 | 20 | 30 | 1 | 0 |
| 5 | 50 | 30 | 1 | 0 |[
{"team_id":10,"team_name":"Leaders FC","num_points":7},
{"team_id":20,"team_name":"Harbor United","num_points":3},
{"team_id":50,"team_name":"Lakeside Rovers","num_points":3},
{"team_id":30,"team_name":"Capital Athletic","num_points":1},
{"team_id":40,"team_name":"Midtown City","num_points":0}
]Team 10 earns a win, a draw, and another win for 7 total points. Team 40 has no matches and remains at 0.
teams:
| team_id | team_name |
|---------|-------------|
| 101 | North Stars |
| 205 | Metro Forge |
| 309 | River Comets|
matches:
| match_id | host_team | guest_team | host_goals | guest_goals |
|----------|-----------|------------|------------|-------------|
| 11 | 101 | 205 | 1 | 1 |
| 12 | 205 | 309 | 2 | 2 |
| 13 | 309 | 101 | 0 | 0 |[
{"team_id":101,"team_name":"North Stars","num_points":2},
{"team_id":205,"team_name":"Metro Forge","num_points":2},
{"team_id":309,"team_name":"River Comets","num_points":2}
]All matches are draws, so every team gains one point per appearance and all totals tie at 2.
teams:
| team_id | team_name |
|---------|--------------|
| 7 | Blue Harbor |
| 8 | Green Harbor |
| 11 | Red Harbor |
| 19 | Gold Harbor |
matches:
| match_id | host_team | guest_team | host_goals | guest_goals |
|----------|-----------|------------|------------|-------------|
| 21 | 7 | 8 | 2 | 1 |
| 22 | 11 | 7 | 4 | 0 |
| 23 | 8 | 11 | 2 | 2 |[
{"team_id":11,"team_name":"Red Harbor","num_points":4},
{"team_id":7,"team_name":"Blue Harbor","num_points":3},
{"team_id":8,"team_name":"Green Harbor","num_points":1},
{"team_id":19,"team_name":"Gold Harbor","num_points":0}
]Team 11 gets one win and one draw. Team 19 never plays and remains in the table with zero points.
Constraints