Frequencies on a board

We have a board with m rows and n columns. In each board cell there is a
digit (0, ..., 9). Write a program that computes the frequency of each
digit in each of the n columns of the board. The number of rows of a
board can be very large.

Input

The input is a series of cases. Each case consists of two integers
greater than zero m and n denoting, respectively, the number of rows and
columns on the board, followed by a row-by-row description of the
board’s digits.

Output

For each case in the input, a frequency table. The table has ten rows,
respectively representing the digits 0, .., 9 and n columns. The table
value in row d column j should be the frequency of digit d in column j
of the corresponding input board. A blank line appears after the
frequency table.

Problem information

Author: Pro1

Generation: 2026-01-25T11:30:01.229Z

© Jutge.org, 2006–2026.
https://jutge.org
