QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 512 MB 總分: 100

#5434. 二进制子串

统计

给定一个整数 $n$,你需要找出一个长度为 $n$ 的仅包含 $0$ 和 $1$ 的字符串,使得该字符串中不同的非空子串数量最大。

输入格式

输入仅包含一行,为一个整数 $n$ ($1 \le n \le 2 \times 10^5$),表示 $01$ 字符串的长度。

输出格式

输出一个长度为 $n$ 的 $01$ 字符串,该字符串在所有长度为 $n$ 的 $01$ 字符串中拥有最多的不同非空子串。如果存在多个解,输出任意一个即可。

样例

样例输入 1

2

样例输出 1

01

样例输入 2

5

样例输出 2

00110

说明

在第一个样例中,共有 $3$ 个不同的非空子串:“0”、“1” 和 “01”。

在第二个样例中,共有 $12$ 个不同的非空子串:“0”、“1”、“00”、“01”、“11”、“10”、“001”、“011”、“110”、“0011”、“0110” 和 “00110”。

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.