QOJ.ac

QOJ

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

#13218. 31 个回文串

Estadísticas

对于给定字符串的每一个前缀,判断是否可以将其拆分为 $1, 2, 3, 4, 5, \dots, 31$ 个非空回文串。

输入格式

输入包含一行 $n$ 个小写拉丁字母 ($1 \le n \le 3 \cdot 10^5$)。

输出格式

输出 $n$ 个非负整数,每行一个。第 $i$ 行应包含一个十进制数。如果你考虑该十进制数的二进制表示,其第 $(j-1)$ 位(从右往左数,从 0 开始)应为 1(如果长度为 $i$ 的前缀可以拆分为 $j$ 个回文串),否则为 0。

样例

样例输入 1

abaa

样例输出 1

1
2
5
14

说明

$1_{10} = 1_2$; $2_{10} = 10_2$; $5_{10} = 101_2$; $14_{10} = 1110_2$; $abaa = aba|a = a|b|aa = a|b|a|a$。

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.