QOJ.ac

QOJ

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

#4294. 细菌

Statistics

Berland 生物大学 (BUB) 正在研究细菌。已知细菌的行为由其 DNA 结构决定。在本题中,我们假设细菌的 DNA 是一个由 0 和 1 组成的字符串。

最近,BUB 的科学家发现了一种新型细菌。其主要特征是当细菌分裂时,其 DNA 不会复制,而是分裂成两半。更准确地说,假设原始细菌的 DNA 是一个长度为偶数 $k$ 的字符串 $S = s_1s_2 \dots s_k$(其中 $s_i$ 表示字符串 $S$ 的第 $i$ 个字符,且等于 0 或 1)。那么,分裂后会产生两个 DNA 分别为 $s_1s_2 \dots s_{\frac{k}{2}}$ 和 $s_{\frac{k}{2}+1} \dots s_{k-1}s_k$ 的细菌。

在实验中,科学家计划使用一个 DNA 长度为 $2^n$ 的细菌。实验包含 $n+1$ 个步骤。在除最后一步外的每一步结束时,当前存在的每个细菌都会分裂。因此,在第一步中,只有一个 DNA 长度为 $2^n$ 的细菌;在第二步中,有两个 DNA 长度为 $2^{n-1}$ 的细菌,依此类推。最终,在第 $n+1$ 步中,将会有 $2^n$ 个细菌,每个细菌的 DNA 仅包含一个字符。

当然,研究 DNA 相同的细菌并没有意义。请确定第一个细菌的 DNA 应该是什么,以便在实验过程中产生的不同 DNA 类型尽可能多。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 20$),表示第一个细菌的 DNA 长度应为 $2^n$。

输出格式

输出一个长度为 $2^n$ 的由 0 和 1 组成的字符串,即第一个细菌的 DNA,使得实验过程中出现的不同 DNA 数量最多。如果存在多个可能的答案,输出其中任意一个即可。

样例

输入 1

3

输出 1

00100111

说明

在第一个样例测试中,实验过程中会出现 9 种不同的 DNA:00100111, 0010, 0111, 00, 10, 01, 11, 0 和 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.