Half-powers of vertices
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are given a directed graph represented by an adjacency matrix. Your task is to determine the in-degree and out-degree for each vertex in the graph. The in-degree is the number of edges coming into a vertex, while the out-degree is the number of edges going out from a vertex.
Input Data
N
: The number of vertices in the graph (1 ≤ N ≤ 100
).An adjacency matrix consisting of
N
rows, each containingN
numbers, where each number is either 0 or 1.
Output Data
For each vertex, output a pair of numbers: the in-degree followed by the out-degree. Provide these pairs for all N
vertices.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 74%