QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23932. Sum Checker

Statistics

Problem Statement

You are given $3$ positive integers $A, B, C$.

If $1$ of these values is the sum of the other $2$ values, print $1$; otherwise, print $0$.

Constraints

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

Input

The input is given in the following format:

A
B
C

Output

If $1$ of the values is the sum of the other $2$ values, print $1$; otherwise, print $0$.

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

3
5
2

Sample Output 1

1
  • Since $B=5$ is the sum of the other $2$ values $A=3$ and $C=2$, print $1$.

Sample 2

Sample Input 2

2
3
4

Sample Output 2

0
  • $A=2$ is not equal to $7$, the sum of the other $2$ values $B=3$ and $C=4$.
  • $B=3$ is not equal to $6$, the sum of the other $2$ values $A=2$ and $C=4$.
  • $C=4$ is not equal to $5$, the sum of the other $2$ values $A=2$ and $B=3$.
  • Therefore, since none of the values is the sum of the other $2$ values, print $0$.

Sample 3

Sample Input 3

100
50
50

Sample Output 3

1
  • Since $A=100$ is the sum of the other $2$ values $B=50$ and $C=50$, print $1$.

Sample 4

Sample Input 4

1
1
1

Sample Output 4

0
  • Since none of the values is the sum of the other $2$ values, print $0$.

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.