304166: CF798A. Mike and palindrome
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Mike and palindrome
题意翻译
## 题目描述 麦克有一个只有小写英文字母的字符串 _s_ 。他想通过改变一个字符 的方式来让整个字符串成为回文字符串。 回文字符串是一个正着读和反着读都一样的字符串。比如说"z", "aaa","aba", "abccba"是回文字符串,而"codeforces", "reality"和"ab"不是回文字符串。 ## 输入输出格式 ### 输入格式 一行,包括一个字符串 _s_ (1<=|s|<=15)。 ### 输出格式 如果麦克能通过只改变一个字符就使整个字符串成回文字符串的话就输出"YES"(不包括双引号),不然的话就输出"NO"(同样不包括双引号) 感谢@deadpool123 提供的翻译题目描述
Mike has a string $ s $ consisting of only lowercase English letters. He wants to change exactly one character from the string so that the resulting one is a palindrome. A palindrome is a string that reads the same backward as forward, for example strings "z", "aaa", "aba", "abccba" are palindromes, but strings "codeforces", "reality", "ab" are not.输入输出格式
输入格式
The first and single line contains string $ s $ ( $ 1<=|s|<=15 $ ).
输出格式
Print "YES" (without quotes) if Mike can change exactly one character so that the resulting string is palindrome or "NO" (without quotes) otherwise.
输入输出样例
输入样例 #1
abccaa
输出样例 #1
YES
输入样例 #2
abbcca
输出样例 #2
NO
输入样例 #3
abcda
输出样例 #3
YES