2024春-A-1 Braille Recognition
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
题目描述
Given a piece of paper, you need to identify the Braille numbers (盲文数字) on it.
Braille is generally represented by a matrix of three rows and two columns of raised or unraised dots. We use *
to represent a raised dot and .
to represent an unraised dot. Braille numbers typically come in two forms, one of which is as follows:
Here's the textual representation:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
---|---|---|---|---|---|---|---|---|---|
* . . . . . |
* . * . . . |
* * . . . . |
* * . * . . |
* . . * . . |
* * * . . . |
* * * * . . |
* . * * . . |
. * * . . . |
. * * * . . |
Note: There are spaces in the text in the table, but they are not actually needed.
The paper is given in a grid of cells. Please count the number of occurrences for each Braille number on the paper.
输入格式
The first line of input consists of two positive integers, and ().
The next lines each contain characters, which are either *
or .
, representing the symbols on the paper.
There may be cases where the numbers overlap, causing duplicated counting, as follows:
****
....
....
For such a case, you should count it as 3 occurrences for the number "3".
输出格式
Output in a single line containing 10 numbers, representing the counts of Braille numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, and 0 respectively. The numbers must be separated by 1 space, and there must be no extra space at the beginning or the end of the line.
样例
7 10
..........
.*..**....
..........
..........
.***......
..*.......
..........
3 0 1 1 0 1 0 0 0 0
限制
对于所有的测试用例,限制为400 ms, 64 MB