Description

Let quasi-palindromic number be such number that adding some leading zeros (possible none) to it produces a palindromic string.

String t is called a palindrome, if it reads the same from left to right and from right to left.

For example, numbers 131 and 2010200 are quasi-palindromic, they can be transformed to strings "131" and "002010200", respectively, which are palindromes.

You are given some integer number x. Check if it's a quasi-palindromic number.

Input

The first line contains one integer number x (1 ≤ x ≤ 109). This number is given without any leading zeroes.

Output

Print "YES" if number x is quasi-palindromic. Otherwise, print "NO" (without quotes).

Sample Input

131

Sample Output

YES

题解

给你一个数,判断它是不是准回文数(补全前导零使其成为回文数)

I think there is no need to tell you how to solve this problem...

 //It is made by Awson on 2017.9.30
 #include <set>
 #include <map>
 #include <cmath>
 #include <ctime>
 #include <queue>
 #include <stack>
 #include <vector>
 #include <cstdio>
 #include <string>
 #include <cstdlib>
 #include <cstring>
 #include <iostream>
 #include <algorithm>
 #define LL long long
 #define Min(a, b) ((a) < (b) ? (a) : (b))
 #define Max(a, b) ((a) > (b) ? (a) : (b))
 using namespace std;
 void read(int &x) {
   ;
   ); ch = getchar());
   ; isdigit(ch); x = (x<<)+(x<<)+ch-, ch = getchar());
   x *= -*flag;
 }

 ];

 void work() {
   read(x);
   ;
   while (x) {
     a[++top] = x%;
     x /= ;
   }
   ;
   ; i <= top && a[i] == ; i++) cnt++;
   ; i <= cnt; i++) top++;
   ;
   ; i <= top/; i++)
     ]) {
       flag = ;
       break;
     }
   printf(flag ? "NO\n" : "YES\n");
 }
 int main() {
   work();
   ;
 }

[Codeforces 863A]Quasi-palindrome的更多相关文章

  1. CodeForces - 600C Make Palindrome 贪心

    A string is called palindrome if it reads the same from left to right and from right to left. For ex ...

  2. Codeforces Round 486C - Palindrome Transformation 贪心

    C. Palindrome Transformation time limit per test 1 second memory limit per test 256 megabytes input ...

  3. Codeforces Gym100952 C. Palindrome Again !!-回文字符串 (2015 HIAST Collegiate Programming Contest)

      C. Palindrome Again !!   time limit per test 1 second memory limit per test 64 megabytes input sta ...

  4. codeforces 600C Make Palindrome

    要保证变化次数最少就是出现次数为奇数的相互转化,而且对应字母只改变一次.保证字典序小就是字典序大的字母变成字典序小的字母. 长度n为偶数时候,次数为奇数的有偶数个,按照上面说的搞就好了. n为奇数时, ...

  5. 【Codeforces 486C】Palindrome Transformation

    [链接] 我是链接,点我呀:) [题意] 光标一开始在p的位置 你可以用上下左右四个键位移动光标(左右)或者更改光标所在的字符(上下增加或减少ascill码) 问你最少要操作多少次才能使得字符串变成回 ...

  6. Codeforces 1304B. Longest Palindrome

    根据数据范围,暴力可以解决,对每一个串,找与其互为回文的串,或者判断自身是否为回文串,然后两两将互为回文的串排列在头尾,中间放且只能最多放一个自身为回文串的串,因为题目说每个串都是不同的 #inclu ...

  7. Codeforces Round #389 Div.2 D. Santa Claus and a Palindrome

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  8. Educational Codeforces Round 2 C. Make Palindrome 贪心

    C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...

  9. Codeforces Gym 100570 E. Palindrome Query Manacher

    E. Palindrome QueryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100570/pro ...

随机推荐

  1. C语言程序设计(基础)- 第14、15周作业

    从本周开始,将作业标记为学校自然周,而不是开课的周数. 要求一(25经验值) 完成14.15周的所有PTA中题目集. 注意1:一周两次pta作业,包括四次. 要求二(50经验值) 博客的具体书写内容和 ...

  2. QT5.8 for embedded

    http://doc.qt.io/qt-5/embedded-linux.html 先占座~

  3. Java作业-数据库

    本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结与数据库相关内容. 在Java中使用数据库要经过以下几个步骤: 1. 注册 JDBC 驱动 Class.forName("com ...

  4. 团队作业7——第二次项目冲刺(Beta版本12.08-12.10)

    1.当天站立式会议照片 本次会议内容:1:每个人汇报自己完成的工作.2:组长分配各自要完成的任务. 2.每个人的工作 黄进勇:项目整合,后台代码. 李勇:前台界面优化. 何忠鹏:数据库模块. 郑希彬: ...

  5. Flask 文件和流

    当我们要往客户端发送大量的数据比较好的方式是使用流,通过流的方式来将响应内容发送给客户端,实现文件的上传功能,以及如何获取上传后的文件. 响应流的生成 Flask响应流的实现原理就是通过Python的 ...

  6. Hadoop安装-部署-测试

    一:准备Linux环境[安装略]        a.修改主机名                vim /etc/sysconfig/network                NETWORKING= ...

  7. c 语言常量

    1,整数常量 整数常量可以是十进制.八进制或十六进制的常量.前缀指定基数:0x 或 0X 表示十六进制,0 表示八进制,不带前缀则默认表示十进制. 整数常量也可以带一个后缀,后缀是 U 和 L 的组合 ...

  8. Python内置函数(48)——__import__

    英文文档: __import__(name, globals=None, locals=None, fromlist=(), level=0) This function is invoked by ...

  9. 新概念英语(1-1)Excuse me!

    Excuse me!Whose handbag is it? A:Excuse me! B:Yes? A:Is this your handbag? B:Pardon? A:Is this your ...

  10. apigw鉴权分析(1-5)亚马逊 - 鉴权分析

    一.访问入口 https://developer.amazon.com/public/zh 二.鉴权方式分析 三.分解结论