You are given an undirected graph, consisting of $N$ vertices and $M$ edges. This graph may not be simple.
The $i$-th edge is $\lbrace u _ i, v _ i \rbrace$.
For each edge $i$, find $A _ i$ , as the number of unordered combinations of $3$ edges $x$ , $y$ , $z$
that those $4$ edges ( $i,x,y,z$ ) forms a subgraph isomorphic to $C _ 4$ ( A cycle with $4$ edges ).
$N$ $M$
$u _ 0$ $v _ 0$
$u _ 1$ $v _ 1$
$\vdots$
$u _ {M-1}$ $v _ {M-1}$
$A _ 0$ $A _ 1$ $\cdots$ $A _ {M-1}$
4 5 0 3 2 0 2 1 2 3 1 3
1 1 1 0 1
4 7 0 1 0 1 0 1 0 3 0 3 1 2 2 3
2 2 2 3 3 6 6
No. | Testdata Range | Score |
---|