QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100 تفاعلية

#7719. 画线

الإحصائيات

这是一个交互式问题。

评测系统拥有一个以 $(X_1, Y_1)$ 和 $(X_2, Y_2)$ 为端点的线段图像。坐标满足以下约束:

  • $X_1, Y_1, X_2, Y_2 \in [-10\,000, 10\,000]$。
  • 线段长度至少为 $100$。

你的任务是还原出相同的图像。

你可以创建多个同类图像:以 $(x_1, y_1)$ 和 $(x_2, y_2)$ 为端点的线段。在你创建图像后,你将根据以下公式获得你的图像与评测系统图像之间的相似度 (sim):

$$\text{dst}(a_1, b_1, a_2, b_2) = \sqrt{(a_1 - a_2)^2 + (b_1 - b_2)^2}$$ $$s = \min(\text{dst}(x_1, y_1, X_1, Y_1) + \text{dst}(x_2, y_2, X_2, Y_2), \text{dst}(x_1, y_1, X_2, Y_2) + \text{dst}(x_2, y_2, X_1, Y_1))$$ $$\text{sim} = \max\left(0, \frac{40\,000 - s}{40\,000}\right)$$

目标是在不超过 $25\,000$ 次尝试内生成相似度为 $100\%$ 的图像。

交互

要绘制一条线段,请输出一行包含四个整数 $x_1, y_1, x_2, y_2$($-10\,000 \le x_1, y_1, x_2, y_2 \le 10\,000$)。该行表示一个包含连接点 $(x_1, y_1)$ 和 $(x_2, y_2)$ 的线段的图像。线段长度必须严格大于零。

生成图像后,评测程序将输出一行包含一个保留一位小数的实数:图像的相似度百分比,向下取整至十分位。你的程序应继续生成图像,直到收到 $100\%$ 的相似度。一旦达到 $100\%$ 相似度,你的程序必须终止。

生成的图像数量不得超过 $25\,000$ 个。注意,只有其中一个生成的图像(在端点顺序不计的情况下)能与评测系统的图像达到 $100\%$ 的相似度。

在每个测试用例中,评测系统的图像是预先固定的,不会根据选手的输出进行调整。

样例

输入格式 1

29.4
94.9
99.7
99.9
99.7
99.9
100.0

输出格式 1

-10000 -10000 10000 10000
0 -1000 0 1000
100 -10 -100 10
-70 0 70 0
-50 0 -50 1
50 0 -50 1
50 0 -50 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.