c语言sscanf函数的用法是什么
279
2022-11-30
ICPC Pacific Northwest Regional Contest 2017 A Odd Palindrome
We say that a string is oddodd if and only if all palindromic substrings of the string have odd length.
Given a string ss, determine if it is oddodd or not.
A substring of a string ss is a nonempty sequence of consecutive characters from ss. A palindromic substring is a substring that reads the same forwards and backwards.
1 Input
The input consists of a single line containing the string ss (1 ≤ |s| ≤ 100)(1≤∣s∣≤100).
It is guaranteed that ss consists of lowercase ASCIIASCII letters (‘a’–‘z’)(‘a’–‘z’) only.
2 Output
If ss is oddodd, then print “Odd.Odd.” on a single line (without quotation marks). Otherwise, print “Or\ not.Or not.” on a single line (without quotation marks).
样例输入复制 1 2 3 4 amanaplanacanalpanama madamimadam annamyfriend nopalindromes 样例输出复制 1 2 3 4 Odd. Odd. Or not. Odd. 用manacher找出所有回文串的长度,判断下是否是奇数即可
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~