QOJ.ac

QOJ

Límite de tiempo: 30 s Límite de memoria: 256 MB Puntuación total: 100

#11398. 别戳破气球

Estadísticas

一个开口的盒子,其底部为正方形,放置在地板上。你可以看到底部垂直竖立着若干根针。

你想要放置一个尽可能大的球形气球,使其接触盒子底部,且不与任何侧壁或针发生干涉。

Java 特别说明:提交的 Java 程序不得使用 “java.awt.geom.Area”。你可以将其用于调试目的。

图 H.1 展示了一个带有针的盒子示例以及对应的最大球形气球。它对应于下方样例输入中的第一个数据集。

图 H.1。上图展示了一个示例布局,下图展示了可以放置的最大球形气球。

输入格式

输入包含一系列数据集。每个数据集的格式如下:

$n \ w$ $x_1 \ y_1 \ h_1$ $\vdots$ $x_n \ y_n \ h_n$

数据集的第一行包含两个正整数 $n$ 和 $w$,中间用空格隔开。$n$ 表示针的数量,$w$ 表示侧壁的高度。

盒子的底部是一个 $100 \times 100$ 的正方形。底面的四个角位于位置 $(0, 0, 0)$、$(0, 100, 0)$、$(100, 100, 0)$ 和 $(100, 0, 0)$。

接下来的 $n$ 行,每行包含三个整数 $x_i, y_i$ 和 $h_i$。$(x_i, y_i, 0)$ 和 $h_i$ 分别表示第 $i$ 根针的底座位置和高度。没有两根针位于相同的位置。

你可以假设 $1 \le n \le 10$,$10 \le w \le 200$,$0 < x_i < 100$,$0 < y_i < 100$ 且 $1 \le h_i \le 200$。你可以忽略针和墙壁的厚度。

输入的结束由一行两个零表示。数据集的数量不超过 1000。

输出格式

对于每个数据集,输出一行,包含可以接触盒子底部且不与侧壁或针发生干涉的气球的最大半径。输出的误差不应超过 $0.0001$。

样例

输入 1

5 16
70 66 40
38 52 20
40 35 10
70 30 10
20 60 10
1 100
54 75 200
1 10
90 10 1
1 11
54 75 200
3 10
53 60 1
61 38 1
45 48 1
4 10
20 20 10
20 80 10
80 20 10
80 80 10
0 0

输出 1

26.00000
39.00000
130.00000
49.49777
85.00000
95.00000

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.