Start: Jun, 30, 2019 09:00:00
2019年度暑期短学期第十天 助教场
End: Jul, 08, 2019 23:59:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 5ms
Memory: 1756kB
Author: 2018212212155
In contest: 1290

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<string>
using namespace std;
int T,i,f;
string s;
int check(string s){
	for(int i=0,j=s.length()-1;i<=j;i++,j--){
		if(s[i]!=s[j])	return 0;
	}
	return 1;
}
int main(){
	scanf("%d",&T);
	while(T--){
		cin>>s;
		f=check(s);
		for(i=0;i<s.length();i++){
			if(f==1)	break;
			string s1=s;
			s1.erase(i,1);
			if(check(s1)==1)	f=1;
		}
		if(f==1)	printf("Yes\n");
		else	printf("No\n");
	}
}