QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 1024 MB

#23934. 出現的數字

İstatistikler

題目描述

給定一個由 $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.