#P1320. 压缩技术(续集版)
压缩技术(续集版)
Description
Suppose a Chinese character is composed of an dot-matrix pattern of and .
We generate a compression code according to the following rule. It is a sequence of consecutive counts: starting from the first symbol of the first row of the dot-matrix pattern, scan in writing order, left to right, top to bottom. The first number gives how many consecutive there are, the second number gives how many consecutive follow, the third number gives how many consecutive follow, the fourth number gives how many consecutive follow, and so on...
For example, the following dot-matrix pattern:
0001000
0001000
0001111
0001000
0001000
0001000
1111111
The corresponding compression code is: (the first number is , and the remaining numbers alternately give the counts of and ; the compression code guarantees the sum of these alternating counts).
Input Format
The character’s dot-matrix (no spaces between symbols).
Output Format
Output one line, the compression code.
0001000
0001000
0001111
0001000
0001000
0001000
1111111
7 3 1 6 1 6 4 3 1 6 1 6 1 3 7
Hint
It is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号