QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 50

#13400. 画图

Estadísticas

Josip 以前用 Logo 语言写代码。他非常喜欢画画,但可惜那些日子已经一去不复返了。怀旧的他决定画一条折线,来表示他的公司在 $n$ 天内的净资产变化。

对于这 $n$ 天中的每一天,他都知道公司的净资产在当天是增加了一个单位(用 '+' 表示)、减少了一个单位(用 '-' 表示),还是保持不变(用 '=' 表示)。在第一天开始之前,净资产等于零。

Josip 将在一个无限大的字符矩阵中画出这条折线。矩阵的行索引向上递增,列索引向右递增。对于第 $i$ 天,他将在第 $i$ 列中绘制一个字符。字符和行索引由以下规则决定:

  • 如果净资产在第 $i$ 天内增加,他将在行索引等于当天开始时的净资产的行中绘制 '/'。
  • 如果净资产在第 $i$ 天内减少,他将在行索引等于当天结束时的净资产的行中绘制 '\'。
  • 如果净资产在第 $i$ 天内没有变化,他将在行索引等于当天净资产的行中绘制 '_'。

所有其他单元格都用 '.' 填充。

你的任务是输出包含整条折线的最小矩阵,即包含 Josip 绘制的所有 '/'、'\' 和 '_' 字符的最小矩阵。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 100$),表示天数。

第二行包含一个长度为 $n$ 的字符串,由字符 '+'、'-' 和 '=' 组成,表示公司净资产在给定期间内的变化情况。

输出格式

输出描述中所述的矩阵。

子任务

在价值 20 分的测试数据中,输入中不会包含字符 '-'。

样例

输入样例 1

7
++---==

输出样例 1

./\....
/..\...
....\__

输入样例 2

5
+=+=+

输出样例 2

..._/
._/..
/....

输入样例 3

4
--=+

输出样例 3

\...
.\_/

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.