QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 100

#15535. 射手岛

統計

你最近被晋升为队长,你的士兵们现在正在风暴中执行一项特殊任务。战场非常特别,它位于北极圈内的一块巨大浮冰上。你在总部协调行动。有许多高端计算机让你随时了解战场的最新进展,AI 界面将战场建模为一个单位正方形网格。每个单位正方形由其在网格中的行和列索引标识。由单位正方形组成的更大矩形由该矩形对角上的两个单位正方形描述。开始时,所有方格都被冰覆盖。

你从计算机接收到两种重要类型的信息:

  1. 关于击中的信息:敌人击中了一个由单位方格 $[x_1,y_1]$ 和 $[x_2,y_2]$ 描述的矩形。该矩形随后立即被冰冷的北极海水淹没。
  2. 士兵的询问:他们询问是否可以乘船从方格 $[x_1,y_1]$ 前往 $[x_2,y_2]$。船可以表示为一个半径为 $0.31416$ 的圆。请注意,船必须始终完全处于水面上,并且不允许离开战场区域。

你的士兵需要你的帮助!你能可靠地引导他们吗?

输入格式

第一行包含一个整数 $L$ ($1 \le L \le 2 \cdot 10^5$),表示接下来的信息行数。

接下来的 $L$ 行,每行包含五个整数 $t, x_1, y_1, x_2, y_2$ ($t \in \{0, 1\}$,$1 \le x_1, x_2 \le 50$,$1 \le y_1, y_2 \le 10^5$)。数字 $t$ 表示信息类型,数对 $[x_1, y_1]$ 和 $[x_2, y_2]$ 指定相应的单位方格。

输出格式

对于每个询问,如果可以从单位方格 $[x_1,y_1]$ 航行到单位方格 $[x_2,y_2]$,则输出 1,否则输出 0。

样例

输入样例 1

6
0 4 4 6 6
0 6 6 7 8
0 1 3 3 3
1 1 7 6 1
1 5 4 6 8
1 4 5 1 3

输出样例 1

0
1
0

输入样例 2

3
0 1 1 1 1
0 1 2 1 2
1 1 1 1 2

输出样例 2

1

说明

图 1:样例输入 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.