QOJ.ac

QOJ

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

#23934. Appearing Numbers

统计

Problem Statement

You are given a sequence of length $N$, $A = (A_1, A_2, \dots, A_N)$, consisting of integers between $0$ and $9$, inclusive. Print all integers that appear at least $1$ time in the sequence $A$, in ascending order.

Constraints

  • $1 \le N \le 100$.
  • $0 \le A_i \le 9$ ($1 \le i \le N$).
  • All input values are integers.

Input

The input is given in the following format:

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

Output

Print all integers that appear at least $1$ time in the sequence $A$, in ascending order, separated by newlines.

Do not print anything other than the result. (Do not print sentences prompting for input, etc.)

For the answer format, you may also refer to the practice problems and their sample solutions.

Sample 1

Sample Input 1

8
2 0 2 3 0 9 1 6

Sample Output 1

0
1
2
3
6
9
  • When the integers that appear at least $1$ time are arranged in ascending order, they are $0, 1, 2, 3, 6, 9$, so print them in $6$ lines.

Sample 2

Sample Input 2

3
9 9 9

Sample Output 2

9
  • The only integer that appears at least $1$ time is $9$, so print it in $1$ line.

Sample 3

Sample Input 3

10
3 1 4 1 5 9 2 6 5 3

Sample Output 3

1
2
3
4
5
6
9
  • When the integers that appear at least $1$ time are arranged in ascending order, they are $1, 2, 3, 4, 5, 6, 9$, so print them in $7$ lines.

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.