[Codeforces 863A]Quasi-palindrome
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
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的更多相关文章
- 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 ...
- Codeforces Round 486C - Palindrome Transformation 贪心
C. Palindrome Transformation time limit per test 1 second memory limit per test 256 megabytes input ...
- 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 ...
- codeforces 600C Make Palindrome
要保证变化次数最少就是出现次数为奇数的相互转化,而且对应字母只改变一次.保证字典序小就是字典序大的字母变成字典序小的字母. 长度n为偶数时候,次数为奇数的有偶数个,按照上面说的搞就好了. n为奇数时, ...
- 【Codeforces 486C】Palindrome Transformation
[链接] 我是链接,点我呀:) [题意] 光标一开始在p的位置 你可以用上下左右四个键位移动光标(左右)或者更改光标所在的字符(上下增加或减少ascill码) 问你最少要操作多少次才能使得字符串变成回 ...
- Codeforces 1304B. Longest Palindrome
根据数据范围,暴力可以解决,对每一个串,找与其互为回文的串,或者判断自身是否为回文串,然后两两将互为回文的串排列在头尾,中间放且只能最多放一个自身为回文串的串,因为题目说每个串都是不同的 #inclu ...
- 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 ...
- Educational Codeforces Round 2 C. Make Palindrome 贪心
C. Make Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/pr ...
- Codeforces Gym 100570 E. Palindrome Query Manacher
E. Palindrome QueryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100570/pro ...
随机推荐
- CountDownLatch 源码解析—— countDown()
上一篇文章从源码层面说了一下CountDownLatch 中 await() 的原理.这篇文章说一下countDown() . public void countDown() { //CountDow ...
- Java之排序
1.插入排序 假设第一个数已经是排好序的,把第二个根据大小关系插到第一个前面或维持不动,把第三个根据前面两个的大小关系插到对应位置,依次往后. public class InsertSort { pu ...
- 201421123042 《Java程序设计》第7周学习总结
1. 本周学习总结 1.1 思维导图:Java图形界面总结 2.书面作业 1. GUI中的事件处理 1.1 写出事件处理模型中最重要的几个关键词. 事件源 事件对象 事件监听器 事件适合配器 1.2 ...
- JVM启动参数
JVM参数的含义 实例见实例分析 参数名称 含义 默认值 -Xms 初始堆大小 物理内存的1/64(<1GB) 默认(MinHeapFreeRatio参数可以调整)空余堆内存小于40%时,J ...
- (原创)带模板的OLE输出EXCEL
其实带模板的OLE输出EXCEL就是将要输出的EXCEL中一些拥有固定值(如标题,表头行等)的单元格先填充好数据和设置好格式后作为模板上传到SAP 中.这样后续在输出EXCEL时只需从SAP中将模板下 ...
- bzoj千题计划276:bzoj4515: [Sdoi2016]游戏
http://www.lydsy.com/JudgeOnline/problem.php?id=4515 把lca带进式子,得到新的式子 然后就是 维护树上一次函数取min 一个调了一下午的错误: 当 ...
- 关于团购VPS的事情报告
作者 玄魂 2017-08-11 玄魂工作室-玄魂 玄魂工作室首先要抱歉,之前的说的继续组织大家购买vps的事情,不会再组织了.原因有以下几个:1)因为人多,需求各不相同,不好协调.2)服务都是购 ...
- NoSQL&MongoDB
MongoDB: Is NoSQL(技术的实现,并非是一个特定的技术,与RMDS对立):Not only SQL 大数据问题:BigData,eg:同时访问几个页面,代码实现几个页面访问量的大小? F ...
- python爬虫requests json与字典对象互相转换
import requests import json ''' json.loads(json_str) json字符串转换成字典 json.dumps(dict) 字典转换成json字符串 ''' ...
- windows系统设置虚拟机开机自启并运行虚拟系统
简述 很多用windows系统电脑开发的童鞋,会在自己电脑上装一个虚拟机,然后在装一个linux系统当作服务器来使用. 但每次电脑开机都要去重启一下虚拟机电源,实在是不划算.下面博主教大家在windo ...