练66.1 黑马篮球队
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
Three-on-three basketball originated from street games among African American children in the United States. Currently, there are players, and pairs of players know each other. The popularity of a player is defined as the number of people who know him.
The coach needs to select three players from these players to form a "dark horse" team for the competition. The three players must all know each other, but the coach wants the sum of their popularity to be as low as possible, hoping for a "stunning" performance.
Input Format
The first line contains two integers and , both not greater than .
The next lines each contain two integers and (), indicating that player and player know each other (there may be duplicate relationships in the data).
For of the data, .
For of the data, .
Output Format
If you can find three players who all know each other, output the minimum possible sum of their popularity among all such choices; otherwise, output .
Sample
5 6
1 2
1 3
2 3
2 4
3 4
4 58
20251129 C班作业(8)
- Status
- Done
- Problem
- 3
- Open Since
- 2025-11-29 0:00
- Deadline
- 2025-12-7 23:59
- Extension
- 24 hour(s)