QOJ.ac

QOJ

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

#23885. العناصر المشتركة

Statistics

المسألة

أُعطيت متتالية أعداد صحيحة $A = (A_{1}, A_{2}, \dots, A_{N})$ طولها $N$ ومتتالية أعداد صحيحة $B = (B_{1}, B_{2}, \dots, B_{M})$ طولها $M$. اطبع جميع الأعداد الصحيحة التي تظهر في كل من $A$ و $B$، مرة واحدة ($1$) لكل منها، بترتيب تصاعدي.

القيود

  • $1 \le N \le 100$.
  • $1 \le M \le 100$.
  • $1 \le A_{i} \le 100$ ($1 \le i \le N$).
  • $1 \le B_{j} \le 100$ ($1 \le j \le M$).

المدخلات

تُعطى المدخلات من الدخل القياسي بالصيغة التالية:

N M
A_1 A_2 ... A_N
B_1 B_2 ... B_M

المخرجات

اطبع جميع الأعداد الصحيحة التي تظهر في كل من $A$ و $B$، مرة واحدة ($1$) لكل منها، بترتيب تصاعدي. افصل بين الأعداد الصحيحة بأسطر جديدة.

أمثلة الإدخال والإخراج

مثال الإدخال 1

6 5
2 4 6 8 10 12
15 12 9 6 3

مثال الإخراج 1

6
12
  • يظهر العدد $6$ في الموضع $3$ من $A$ والموضع $4$ من $B$. كما يظهر العدد $12$ في الموضع $6$ من $A$ والموضع $2$ من $B$. لا يوجد أي عدد صحيح آخر غير $6$ و $12$ يظهر في كل من $A, B$. لذلك، نطبع $6, 12$ بترتيب تصاعدي مفصولين بسطر جديد.

مثال الإدخال 2

3 5
100 100 100
100 100 100 100 100

مثال الإخراج 2

100
  • يظهر العدد $100$ في كل من $A, B$. لا يوجد أي عدد صحيح آخر غير $100$ يظهر في $A, B$. لذلك، نطبع $100$.

مثال الإدخال 3

1 1
2
5

مثال الإخراج 3

```

- لا يوجد أي عدد صحيح يظهر في كل من $A, B$. لذلك، لا نطبع شيئاً.

---

#### مثال الإدخال 4

10 10 76 91 98 7 98 7 98 10 63 91 70 71 10 10 91 70 65 10 63 76

#### مثال الإخراج 4

10 63 76 91 ```

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.