#P6057. [加油武汉] 七步洗手法
[加油武汉] 七步洗手法
Background
We are currently at a critical stage of epidemic prevention and control. Everyone should wash their hands often to prevent infection through contact.
Problem Description
Given an undirected complete graph with vertices, where edges are white and the remaining edges are black.
You need to find the number of monochromatic 3-cycles (that is, triangles).
Input Format
The first line contains integers , with the meaning as described above.
The remaining lines each contain two integers , representing the two endpoints of a white edge. It is guaranteed that the given white edges have no multiple edges and no self-loops.
Output Format
Output one integer in one line, which is the answer.
5 3
1 5
2 5
3 5
4
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5