[BOJ 15104] Odd Palindrome
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
1
Time limit:
1.0s
Memory limit:
512M
Problem types
Allowed languages
We say that a string is odd if and only if all palindromic substrings of the string have odd length.</p>
Given a string s, determine if it is odd or not.
A substring of a string s is a nonempty sequence of consecutive characters from s. A palindromic substring is a substring that reads the same forwards and backwards.
입력 형식
The input consists of a single line containing the string s (1 ≤ |s| ≤ 100).</p>
It is guaranteed that s consists of lowercase ASCII letters (‘a’–‘z’) only
출력 형식
If s is odd, then print “Odd.” on a single line (without quotation marks). Otherwise, print “Or not.” on a single line (without quotation marks).
예제 입력 1
amanaplanacanalpanama
예제 출력 1
Odd.
예제 입력 2
madamimadam
예제 출력 2
Odd.
예제 입력 3
annamyfriend
예제 출력 3
Or not.
예제 입력 4
nopalindromes
예제 출력 4
Odd.
Comments