QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB

#23970. 返鄉 2

Statistics

海狸比太郎決定返鄉。比太郎返鄉如果搭乘電車需要 $X$ 日圓,如果搭乘公車需要 $Y$ 日圓。此外,如果不搭乘電車或公車中的某一種,比太郎就無法返鄉。當比太郎持有的現金為 $Z$ 日圓時,如果比太郎能用這筆錢返鄉則輸出 $1$,否則輸出 $0$。

限制條件

  • $1 \le X \le 100$。
  • $1 \le Y \le 100$。
  • $1 \le Z \le 100$。
  • 輸入的值皆為整數。

輸入格式

輸入以下列格式給出:

X
Y
Z

輸出格式

如果比太郎能夠返鄉則輸出 $1$,否則輸出 $0$。

除答案外請勿輸出任何內容。(亦請勿輸出提示輸入的文字等。)

範例

範例輸入 1

7
2
3

範例輸出 1

1

範例說明 1

  • 搭乘電車返鄉需要 $7$ 日圓,但比太郎只有 $3$ 日圓,因此無法搭乘電車返鄉。
  • 搭乘公車返鄉需要 $2$ 日圓,而比太郎有 $3$ 日圓,因此可以搭乘公車返鄉。

比太郎可以返鄉。因此輸出 $1$。

範例輸入 2

10
20
1

範例輸出 2

0

範例說明 2

  • 搭乘電車返鄉需要 $10$ 日圓,但比太郎只有 $1$ 日圓,因此無法搭乘電車返鄉。
  • 搭乘公車返鄉需要 $20$ 日圓,但比太郎只有 $1$ 日圓,因此無法搭乘公車返鄉。

比太郎無法返鄉。因此輸出 $0$。

範例輸入 3

3
5
3

範例輸出 3

1

範例說明 3

  • 搭乘電車返鄉需要 $3$ 日圓,而比太郎有 $3$ 日圓,因此可以搭乘電車返鄉。
  • 搭乘公車返鄉需要 $5$ 日圓,但比太郎只有 $3$ 日圓,因此無法搭乘公車返鄉。

比太郎可以返鄉。因此輸出 $1$。

範例輸入 4

1
1
10

範例輸出 4

1

範例說明 4

  • 搭乘電車返鄉需要 $1$ 日圓,而比太郎有 $10$ 日圓,因此可以搭乘電車返鄉。
  • 搭乘公車返鄉需要 $1$ 日圓,而比太郎有 $10$ 日圓,因此可以搭乘公車返鄉。

比太郎可以返鄉。因此輸出 $1$。

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.