QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#23904. Sällsynt tal

الإحصائيات

Problembeskrivning

Du får en heltalsföljd $A = (A_1, A_2, \dots, A_N)$ med längden $N$.

Bland de heltal som förekommer i $A$, skriv ut det heltal som förekommer minst antal gånger. Om det finns flera sådana heltal, skriv ut det minsta av dem.

Indata

Indata ges från standardinmatningen i följande format:

N
A_1 A_2 ... A_N

Utdata

Bland de heltal som förekommer i $A$, skriv ut det heltal som förekommer minst antal gånger. Om det finns flera sådana heltal, skriv ut det minsta av dem.

Exempel

Exempel 1

Indata
3
3 4 3
Utdata
4
Förklaring

$A$ innehåller $3$ totalt $2$ gånger och $4$ totalt $1$ gång. Andra heltal än $3, 4$ förekommer inte. Bland dessa är antalet förekomster av $4$ minst, så skriv ut $4$.

Exempel 2

Indata
5
4 4 8 2 5
Utdata
2
Förklaring

$A$ innehåller $2$ totalt $1$ gång, $4$ totalt $2$ gånger, $5$ totalt $1$ gång och $8$ totalt $1$ gång. Andra heltal än $2, 4, 5, 8$ förekommer inte. Bland dessa är de heltal som förekommer minst antal gånger $2, 5, 8$. Skriv därför ut $2$, som är det minsta bland $2, 5, 8$.

Exempel 3

Indata
8
8 8 7 7 6 6 5 5
Utdata
5

Begränsningar

  • $1 \le N \le 100$.
  • $1 \le A_i \le 2000$ ($1 \le i \le N$).
  • Alla indatavärden är heltal.

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.