QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#2705. 混音带管理

Statistics

Mary 制作了一份包含她最喜爱的雷鬼音乐的混音带。这份混音带由她电脑上的一系列 MP3 文件组成,她想与朋友 Wendy 和 Larry 分享。然而,她知道朋友们的音乐品味不同,因此对曲目播放顺序的偏好也不同。

Mary 知道 Wendy 是 Windows 用户,而 Larry 是 Linux 用户,她意识到可以利用这一点。这是因为 Windows 和 Linux 在目录中包含数字数据的文件名排序方式不同。在 Windows 中,文件名中的数字被视为实际数值,从而使文件按这些数字的递增值排序。在 Linux 中,对数字没有特殊处理,因此文件名按字典序排序。参见图 M.1,了解两种操作系统下文件排序的示例。

图 M.1:第一个样例的说明。注意,文件扩展名 .mp3 不影响排序,仅供说明。

在决定了 Wendy 和 Larry 听歌的顺序后,Mary 已经按照 Larry 的品味对文件进行了排序。现在她想重命名这些文件,使得文件名是互不相同且不含前导零的正整数,它们按字典序递增排列,并且当按数值排序时,新的顺序将符合 Wendy 的品味。为此,她给出了一个排列 $p_1, \dots, p_n$,描述了如何将 Larry 的列表重新排列为 Wendy 的列表:对于每个 $i$,按字典序排列后的第 $i$ 个数字必须是按数值从小到大排序后的第 $p_i$ 个数字。请帮助 Mary 找到一个合适的文件名序列。

输入格式

输入包含: 一行包含一个整数 $n$ ($1 \le n \le 100$),表示曲目数量。 一行包含 $n$ 个互不相同的整数 $p_1, \dots, p_n$ ($1 \le p_i \le n$,对于每个 $i$),即给定的排列。

输出格式

输出 $n$ 个按字典序递增排列的互不相同的整数,即你的文件名序列。所有数字必须是小于 $10^{1000}$ 的正整数,且不得包含前导零。任何有效的序列均可被接受。

样例

输入 1

7
4 2 6 1 5 7 3

输出 1

337 34 3401 7 780 7803 79

输入 2

4
4 1 3 2

输出 2

234 6 87 9

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.