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: 2017211909047
In contest: 1290

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int n;
	cin >> n;
	while (n--){
		int flag = 0;
		string a;
		cin >> a;
		string b = a;
		reverse(b.begin(), b.end());
		if (a == b)
			flag = 1;
		else{
			int lena = a.size();
			for (int i = 0; i < lena; i++){
				string s = a;
				s.erase(i, 1);
				string t = s;
				reverse(t.begin(), t.end());
				if (t == s)
					flag = 1;
			}
		}
		if (flag == 1)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}