B - Palindrome with leading zeros
Editorial
/
Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 200 点
問題文
整数 N が与えられます。
N を十進法で表した文字列の先頭に 0 個以上の 0
をつけることで、回文にすることはできますか?
制約
- 0 \leq N \leq 10^9
入力
入力は以下の形式で標準入力から与えられる。
N
出力
回文にできるなら Yes
、できないなら No
を出力せよ。
入力例 1
1210
出力例 1
Yes
1210
の先頭に 1 個の 0
をつけると 01210
となり回文になります。
入力例 2
777
出力例 2
Yes
777
はもともと回文です。
入力例 3
123456789
出力例 3
No
Score : 200 points
Problem Statement
Given is an integer N.
Is it possible to add zero or more 0
s at the beginning of the string representing N in base ten to get a palindrome?
Constraints
- 0 \leq N \leq 10^9
Input
Input is given from Standard Input in the following format:
N
Output
If a palindrome can be made, print Yes
; otherwise, print No
.
Sample Input 1
1210
Sample Output 1
Yes
Adding one 0
at the beginning of 1210
results in 01210
, a palindrome.
Sample Input 2
777
Sample Output 2
Yes
777
is already a palindrome.
Sample Input 3
123456789
Sample Output 3
No