QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB

#23984. Mex

통계

Problem Statement

You are given integers $A$ and $B$ that are greater than or equal to $0$.

Print the smallest integer greater than or equal to $0$ that is neither $A$ nor $B$.

Constraints

  • $0 \le A \le 100$.
  • $0 \le B \le 100$.
  • All input values are integers.

Input

The input is given in the following format:

A B

Output

Print the smallest integer greater than or equal to $0$ that is neither $A$ nor $B$.

Do not print anything other than the answer. (For example, do not print any text prompting for input.)

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

Sample 1

Input

0 4

Output

1

Among the integers greater than or equal to $0$ that are neither $0$ nor $4$, the smallest one is $1$. Therefore, print $1$.

Sample 2

Input

1 0

Output

2

Among the integers greater than or equal to $0$ that are neither $1$ nor $0$, the smallest one is $2$. Therefore, print $2$.

Sample 3

Input

9 12

Output

0

Among the integers greater than or equal to $0$ that are neither $9$ nor $12$, the smallest one is $0$. Therefore, print $0$.

Sample 4

Input

0 0

Output

1

Among the integers greater than or equal to $0$ that are neither $0$ nor $0$, the smallest one is $1$. Therefore, print $1$.

Note that $A$ and $B$ may be equal.

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.