#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
bool check(const string &s, int l, int r);
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
string s;
cin >> s;
if(s.size()<4){
cout << "No\n";
continue;
}
bool out=false;
for (int j = 1; j < s.size() - 2; j++) {
if(check(s, 0, j) && check(s, j+1, s.size()-1)){
out=true;
break;
}
}
cout << (out ? "Yes\n" : "No\n");
}
return 0;
}
bool check(const string &s, int l, int r){
int mid=(l+r)>>1;
for(int i=l ; i<=mid ; i++){
if(s[i]!=s[r-i+l]) return false;
}
return true;
}code
这是 2026年11月9日 存档的第 1 版,不是当前版本。查看当前版本