QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#8965. 果冻

Statistics

我们不谈悲伤的第三章,正如歌中所唱。虽然那章确实很悲伤,但让我们想起一首欢快的歌吧。 你知道什么是 šnenokle(雪球甜点)吗?那 šufnudle(土豆面疙瘩)呢?Pihtije(肉冻)?Knaput? Malnar 先生知道,但他需要你帮忙解决以下问题:

给定一个偶数 $N$。如果集合 $S \subseteq \{0, 1, \dots, 2^N - 1\}$ 中所有 $\binom{|S|}{2}$ 个元素对的按位异或(XOR)值互不相同,则称该集合 $S$ 是“饥饿的”。 请找出一个尽可能大的饥饿集合。

输入格式

输入仅一行,包含一个自然数 $N$。

输出格式

第一行输出你找到的饥饿集合的大小。 第二行输出该集合的元素,以空格分隔。

子任务

子任务 $N$ $t_1$ $t_2$ $t_3$ 分值
1 18 267 283 512 20
2 20 444 462 1024 20
3 26 2019 2040 8192 20
4 28 3295 3327 16384 20
5 30 5377 5430 32768 20

如果你在某个子任务中输出的饥饿集合大小为 $t$,则该子任务的得分计算公式如下:

$$ \text{bodovi}(t) = \begin{cases} 2.4 \cdot \frac{t}{t_1} & t < t_1 \\ 2.4 + 3.6 \cdot \frac{t - t_1}{t_2 - t_1} & t_1 \le t < t_2 \\ 6 + 12 \cdot \frac{t - t_2}{t_3 - t_2} & t_2 \le t < t_3 \\ 20 & t_3 \le t \end{cases} $$

每个子任务的得分将四舍五入保留两位小数。总分将是各子任务得分之和,同样四舍五入保留两位小数。 你的源代码大小限制为 1 MiB。

样例

输入 1

4

输出 1

6
0 1 2 4 8 15

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.