QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓

#9267. 平原探险

統計

Flatland 是一个二维平面。两个坐标都不为零的点被称为“自由点”(free points)。至少有一个坐标为零的点被称为“自定义点”(custom points);当经过这些点时,需要支付 1 flatland dollar 作为费用。

探险家站在坐标为非零整数 $x_1$ 和 $y_1$ 的自由点上,他的目标是到达坐标为非零整数 $x_2$ 和 $y_2$ 的自由点。他可以选择任何他想要的路线。请计算探险家需要支付的最低费用。

输入格式

输入包含四个整数 $x_1, y_1, x_2$ 和 $y_2$,分别表示起点和终点的坐标($x_1 \neq 0, y_1 \neq 0, x_2 \neq 0, y_2 \neq 0, -10\,000 \leq x_1, y_1, x_2, y_2 \leq 10\,000$)。

输出格式

输出探险家需要支付的以 flatland dollars 为单位的最低费用。

样例

样例输入 1

25 11 -20 -20

样例输出 1

1

样例输入 2

20 20 20 21

样例输出 2

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.