QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB

#23934. 出现的数字

统计

题目描述

给定一个由 $0$ 以上且 $9$ 以下的整数组成的长度为 $N$ 的数列 $A = (A_1, A_2, \dots, A_N)$。请按从小到大的顺序输出在数列 $A$ 中至少出现过 $1$ 次的所有整数。

数据范围

  • $1 \le N \le 100$。
  • $0 \le A_i \le 9$($1 \le i \le N$)。
  • 输入的所有值均为整数。

输入格式

输入按以下格式给出:

$N$ $A_1$ $A_2$ $\dots$ $A_N$

输出格式

请将数列 $A$ 中至少出现过 $1$ 次的所有整数按从小到大的顺序、以换行分隔进行输出。

不要输出除结果以外的任何内容。(也不要输出提示输入的文字等。)

关于作答格式,也可以参考练习题及其解答示例。

样例 1

样例输入 1

8
2 0 2 3 0 9 1 6

样例输出 1

0
1
2
3
6
9
  • 将至少出现过 $1$ 次的整数按从小到大的顺序排列得到 $0, 1, 2, 3, 6, 9$,因此分 $6$ 行输出它们。

样例 2

样例输入 2

3
9 9 9

样例输出 2

9
  • 至少出现过 $1$ 次的整数只有 $9$,因此用 $1$ 行输出它。

样例 3

样例输入 3

10
3 1 4 1 5 9 2 6 5 3

样例输出 3

1
2
3
4
5
6
9
  • 将至少出现过 $1$ 次的整数按从小到大的顺序排列得到 $1, 2, 3, 4, 5, 6, 9$,因此分 $7$ 行输出它们。

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.