QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓

#10912. 和谐中的和谐

Estadísticas

Haha 是一位幽默的和谐之神。为什么这么说呢?事实上,Haha 很健忘,但他却认为自己拥有极好的记忆力。Haha 负责平衡世界上各种元素的力量。这些力量源自生长在 Hahiland 的和谐果实。Hahiland 有 $n$ 个部落,每个部落负责一种元素,例如火、水等。Hahiland 有一块肥沃的土地,土壤非常适合种植和谐果实。

每年春天,Haha 都会将这块土地分成 $n$ 个部分,每个部分的面积相等。然后,每个部落选择一个部分作为他们的领地,在上面播下和谐种子的种子,并赋予种子某种元素力量。虽然元素力量有助于植物生长,但当果实成熟时,只有拥有相同元素力量的部落才能收获它们。

“我的记忆力非常好。我根本不需要记录我的划分计划!这一切都清晰地印在我的脑海里!”Haha 自信满满地说道。

秋天到了,Haha 凭记忆再次将土地分成了 $n$ 个部分。但实际上,这与上次的划分并不完全相同。人们不敢告诉这位和谐之神他错了。因此,他们讨论如何分配这 $n$ 个部分,以确保每个部落能收获的植物面积的最小值尽可能大。

Hahiland 的成员们想知道,无论 Haha 如何划分土地,每个部落能收获的植物面积的最小值最大能保证是多少,以便为他们的后代着想。请用你的智慧计算出这个值,让他们不再焦虑。

简而言之,给定 $n$,确定: $$\min_{S, A} \left\{ \max_{p} \left\{ \min_{i=1}^{n} \{|S_i \cap A_{p_i}|\} \right\} \right\}$$ 其中 $S$ 和 $A$ 分别表示春天和秋天划分的土地部分(整个土地和各个部分可以用二维平面上的区域表示,满足 $|S_1| = |S_2| = \dots = |S_n| = |A_1| = |A_2| = \dots = |A_n|$),$p$ 表示 ${1, 2, \dots, n}$ 的一个排列(满足 ${p_1, p_2, \dots, p_n} = {1, 2, \dots, n}$)。

此外,假设整个土地的总面积为 $1$,且如题所示,整个土地的形状对本题没有影响。

输入格式

输入一行,包含一个整数 $n$ ($1 \le n \le 500$),表示部落的数量。

输出格式

输出一行,包含一个保留小数点后 9 位有效数字的实数,表示答案。

样例

样例输入 1

1

样例输出 1

1.000000000

样例输入 2

2

样例输出 2

0.250000000

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.