首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
快乐小土狗
2026年3月25日 18:30
回文子串数量 题解:
P812
回复 0
|
赞 9
|
浏览 120
#include <iostream> #include <string> using namespace std; // 统计回文子串数量 int countSubstrings(string s) { int n = s.size(); int ans = 0; // 遍历所有可能的回文中心 for (int i = 0; i < n; ++i) { // 情况1:奇数长度回文,中心为单个字符 i int l = i, r = i; while ...
题目
回文子串数量
题解数量
1
发布题解
在线答疑
热门题解
1
回文子串数量 题解: