摘要: class Solution { public: string longestPalindrome(string s) { int n=s.size(); string ss; ss+="$#"; // 预处理字符串,将每个字符前后插入#,处理奇数和偶数长度回文的统一问题 // 例如:s="abba 阅读全文
posted @ 2025-07-02 16:28 Qacter 阅读(9) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> #include <string> using namespace std; void solve() { string s, p; cin >> s >> p; s = " " + s; p = " " + p; // 转 阅读全文
posted @ 2025-07-02 16:25 Qacter 阅读(4) 评论(0) 推荐(0)