]. De Bruijn序列

    Type: Default 1000ms 256MiB

De Bruijn序列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

翻译自 CSES-1692 题。

题目描述

你的任务是构造一个最短的二进制字符串,使其包含所有可能的长度为 nn 的子字符串。

例如,当 n=2n=2 时,字符串 "00110" 是一个有效的解,因为它的长度为 22 的所有子字符串是 "00", "01", "10", 和 "11"。

输入格式

输入只有一行,包含一个整数 nn

输出格式

输出一个最短的二进制字符串,包含所有长度为 nn 的子字符串。你可以输出任何一个有效的解。

样例

2
00110

说明/提示

1n151 \leq n \leq 15

CSES4 图论

Not Claimed
Status
Done
Problem
36
Open Since
2025-5-21 0:00
Deadline
2025-5-31 23:59
Extension
24 hour(s)