atcoder#ABC258G. [ABC258G] Triangle
[ABC258G] Triangle
Score : points
Problem Statement
You are given a simple undirected graph with vertices.
is given as the adjacency matrix . That is, there is an edge between Vertices and if is , and there is not if is .
Find the number of triples of integers satisfying such that there is an edge between Vertices and , an edge between Vertices and , and an edge between Vertices and .
Constraints
- is the adjacency matrix of a simple undirected graph .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
4
0011
0011
1101
1110
2
satisfy the condition.
does not satisfy the condition, because there is no edge between Vertices and .
Thus, the answer is .
10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0