QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100

#11077. ASCII 加法

统计

如今,智能手机应用程序可以即时翻译文本,甚至在您将手机摄像头对准数学题时就能将其解出。您的任务是实现一种让人回想起过去的功能——将两个以 ASCII 艺术形式书写的整数相加。

ASCII 艺术是一个高度恰好为 7 行的字符矩阵,其中每个字符要么是点(.),要么是小写字母 x

给定一个形如 $a + b$ 的表达式,其中 $a$ 和 $b$ 均为正整数。该表达式通过将所有表达式字符($a$ 和 $b$ 的数字以及 + 号)转换为 $7 \times 5$ 的矩阵,并在相邻的单个矩阵之间用一列点字符连接,从而转换为 ASCII 艺术。对应于数字和 + 号的精确矩阵如下所示:

xxxxx  ....x  xxxxx  xxxxx  x...x  xxxxx  xxxxx  xxxxx  xxxxx  xxxxx  .....
x...x  ....x  ....x  ....x  x...x  x....  x....  ....x  x...x  x...x  ..x..
x...x  ....x  ....x  ....x  x...x  x....  x....  ....x  x...x  x...x  ..x..
x...x  ....x  xxxxx  xxxxx  xxxxx  xxxxx  xxxxx  ....x  xxxxx  xxxxx  xxxxx
x...x  ....x  x....  ....x  ....x  ....x  x...x  ....x  x...x  ....x  ..x..
x...x  ....x  x....  ....x  ....x  ....x  x...x  ....x  x...x  ....x  ..x..
xxxxx  ....x  xxxxx  xxxxx  ....x  xxxxx  xxxxx  ....x  xxxxx  xxxxx  .....

给定一个形如 $a + b$ 的表达式的 ASCII 艺术,请找出加法的结果,并将其以 ASCII 艺术形式输出。

输入格式

输入包含恰好 7 行,包含一个形如 $a + b$ 的表达式的 ASCII 艺术,其中 $a$ 和 $b$ 均为正整数,最多包含 9 位十进制数字,且书写时不带前导零。

输出格式

输出 7 行,包含对应加法结果的 ASCII 艺术,不带前导零。

样例

输入 1

....x.xxxxx.xxxxx.x...x.xxxxx.xxxxx.xxxxx.......xxxxx.xxxxx.xxxxx
....x.....x.....x.x...x.x.....x.........x...x...x...x.x...x.x...x
....x.....x.....x.x...x.x.....x.........x...x...x...x.x...x.x...x
....x.xxxxx.xxxxx.xxxxx.xxxxx.xxxxx.....x.xxxxx.xxxxx.xxxxx.x...x
....x.x.........x.....x.....x.x...x.....x...x...x...x.....x.x...x
....x.x.........x.....x.....x.x...x.....x...x...x...x.....x.x...x
....x.xxxxx.xxxxx.....x.xxxxx.xxxxx.....x.......xxxxx.xxxxx.xxxxx

输出 1

....x.xxxxx.xxxxx.xxxxx.x...x.xxxxx.xxxxx
....x.....x.....x.x.....x...x.x.........x
....x.....x.....x.x.....x...x.x.........x
....x.xxxxx.xxxxx.xxxxx.xxxxx.xxxxx.....x
....x.x.........x.....x.....x.....x.....x
....x.x.........x.....x.....x.....x.....x
....x.xxxxx.xxxxx.xxxxx.....x.xxxxx.....x

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.