QOJ.ac

QOJ

Limite de temps : 3.0 s Limite de mémoire : 512 MB Points totaux : 100

#11751. 双重回文数

Statistiques

如果一个字符串 $a$ 是回文串,且它可以表示为两个非空回文串 $b$ 和 $c$ 的拼接,则称 $a$ 为“双回文串”(doublindrome)。

给定一个由小写英文字母组成的字符串 $s$,你需要求出 $s$ 中长度不小于 $k$ 的不同双回文子串的数量。如果两个子串作为字符串不同,则认为它们是不同的。

输入格式

第一行包含一个整数 $k$ ($2 \le k \le 10^4$)。第二行包含字符串 $s$,由小写英文字母组成 ($k \le |s| \le 10^4$)。

输出格式

输出一个整数:问题的答案。

样例

输入 1

3
xyxxyxxyx

输出 1

2

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.