QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 1024 MB

#23984. Mex

統計

โจทย์ปัญหา

กำหนดจำนวนเต็ม $A$ และ $B$ ที่มีค่าตั้งแต่ $0$ ขึ้นไป

จงแสดงจำนวนเต็มที่มีค่าตั้งแต่ $0$ ขึ้นไปที่น้อยที่สุด ซึ่งไม่ใช่ทั้ง $A$ และ $B$

ข้อจำกัด

  • $0 \le A \le 100$
  • $0 \le B \le 100$
  • ค่าที่รับเข้ามาทั้งหมดเป็นจำนวนเต็ม

ข้อมูลนำเข้า

ข้อมูลนำเข้าจะให้มาในรูปแบบต่อไปนี้:

A B

ข้อมูลส่งออก

จงแสดงจำนวนเต็มที่มีค่าตั้งแต่ $0$ ขึ้นไปที่น้อยที่สุด ซึ่งไม่ใช่ทั้ง $A$ และ $B$

ห้ามแสดงสิ่งอื่นใดนอกจากคำตอบ (เช่น ห้ามแสดงข้อความที่ให้ป้อนข้อมูลนำเข้า)

สำหรับรูปแบบการส่งคำตอบ สามารถดูตัวอย่างได้จากโจทย์ฝึกหัดและตัวอย่างคำตอบ

ตัวอย่างที่ 1

ข้อมูลนำเข้า

0 4

ข้อมูลส่งออก

1

ในบรรดาจำนวนเต็มตั้งแต่ $0$ ขึ้นไปที่ไม่ใช่ทั้ง $0$ และ $4$ จำนวนที่น้อยที่สุดคือ $1$ ดังนั้นจึงแสดงค่า $1$

ตัวอย่างที่ 2

ข้อมูลนำเข้า

1 0

ข้อมูลส่งออก

2

ในบรรดาจำนวนเต็มตั้งแต่ $0$ ขึ้นไปที่ไม่ใช่ทั้ง $1$ และ $0$ จำนวนที่น้อยที่สุดคือ $2$ ดังนั้นจึงแสดงค่า $2$

ตัวอย่างที่ 3

ข้อมูลนำเข้า

9 12

ข้อมูลส่งออก

0

ในบรรดาจำนวนเต็มตั้งแต่ $0$ ขึ้นไปที่ไม่ใช่ทั้ง $9$ และ $12$ จำนวนที่น้อยที่สุดคือ $0$ ดังนั้นจึงแสดงค่า $0$

ตัวอย่างที่ 4

ข้อมูลนำเข้า

0 0

ข้อมูลส่งออก

1

ในบรรดาจำนวนเต็มตั้งแต่ $0$ ขึ้นไปที่ไม่ใช่ทั้ง $0$ และ $0$ จำนวนที่น้อยที่สุดคือ $1$ ดังนั้นจึงแสดงค่า $1$

โปรดสังเกตว่า $A$ และ $B$ อาจมีค่าเท่ากันได้

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.