当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3793:Is It Symmetric

题目描述
It is easy to see that a string of digits like 1234321 is symmetric with 4 being the central digit. However it is less obvious if we consider the string as a circular one and shift it to the left as 2343211. Your task is to write a program to check if a circular string is symmetric.
输入解释
Your program must read test cases from standard input.
The input file consists of several test cases. Each case occupies a line which contains the string. Each string contains less than 100 digits.
The input is finished by a "#".
输出解释
For each test case, your program must output to standard output. If the string is not symmetric, output "NO" in a line; else output "YES", followed by a space and the position of the center (the position index starts from 0). It is guaranteed that the length of the string is an odd number and the center is unique.
输入样例
2112343
798
#
输出样例
YES 5
NO
来自杭电HDUOJ的附加信息
Recommend notonlysuccess

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3793

最后修改于 2020-10-25T23:07:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)