E - Lovely Palindromes
Description
Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 are not.
Pari is trying to love them too, but only very special and gifted people can understand the beauty behind palindrome numbers. Pari loves integers with even length (i.e. the numbers with even number of digits), so she tries to see a lot of big palindrome numbers with even length (like a 2-digit 11 or 6-digit 122221), so maybe she could see something in them.
Now Pari asks you to write a program that gets a huge integer n from the input and tells what is the n-th even-length positive palindrome number?
Input
The only line of the input contains a single integer n (1 ≤ n ≤ 10100 000).
Output
Print the n-th even-length palindrome number.
Sample Input
Input1Output11Input10Output1001
水题!!
正反各输出一次。
附AC代码:
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std; int main(){
string s;
while(cin>>s){
cout<<s;
for(int i=s.size()-;i>=;i--){
cout<<s[i];
}
cout<<endl;
}
return ;
}
E - Lovely Palindromes的更多相关文章
- Codeforces Round #360 (Div. 2) B. Lovely Palindromes 水题
B. Lovely Palindromes 题目连接: http://www.codeforces.com/contest/688/problem/B Description Pari has a f ...
- codeforces 688B B. Lovely Palindromes(水题)
题目链接: B. Lovely Palindromes time limit per test 1 second memory limit per test 256 megabytes input s ...
- CodeForces 688B Lovely Palindromes (水题回文)
题意:给一个数n,让你找出长度为偶数,并且是第 n 个回文数. 析:你多写几个就知道了,其实就是 n,然后再加上n的逆序,不过n有点大,直接用string 好了. 代码如下: #include < ...
- CF688B Lovely Palindromes 题解
Content 输入一个数 \(n\),输出第 \(n\) 个偶数位回文数. 数据范围:\(1\leqslant n\leqslant 10^{10^5}\). Solution 一看这吓人的数据范围 ...
- cf688B-Lovely Palindromes
http://codeforces.com/problemset/problem/688/B B. Lovely Palindromes time limit per test 1 second me ...
- 套题 codeforces 360
A题:Opponents 直接模拟 #include <bits/stdc++.h> using namespace std; ]; int main() { int n,k; while ...
- UVA - 11584 Partitioning by Palindromes[序列DP]
UVA - 11584 Partitioning by Palindromes We say a sequence of char- acters is a palindrome if it is t ...
- hdu 1318 Palindromes
Palindromes Time Limit:3000MS Memory Limit:0KB 64bit ...
- dp --- Codeforces 245H :Queries for Number of Palindromes
Queries for Number of Palindromes Problem's Link: http://codeforces.com/problemset/problem/245/H M ...
随机推荐
- iLBC简要介绍
iLBC(internet lowbitrate codec):是全球著名语音引擎提供商Global IP Sound开发,它是低比特率的编码解码器,提供在丢包时具有的强大的健壮性.iLBC 提供的语 ...
- C++字符串操作二
#include <iostream> #include <assert.h> using namespace std; //模拟实现strcmp函数. bool my_str ...
- WPF03(样式)
说起样式,大家第一反应肯定是css,好的,先上一段代码. 1 html{border:0;} 2 ul,form{margin:0; padding:0} 3 body,div,th,td,li,dd ...
- 对A-Star寻路算法的粗略研究
首先来看看完成后的效果: 其中灰色代表路障,绿色是起点和移动路径,红色代表终点 // = openArray[i+1].F) { minNode = openArray[i+1]; } } sta ...
- KMP算法模式匹配
转载请注明出处 http://blog.csdn.net/pony_maggie/article/details/37832707 作者:小马 在一个长串中查找一个子串是较经常使用的操作.各种信息检索 ...
- BZOJ 2818 Gcd 线性欧拉
题意:链接 方法:线性欧拉 解析: 首先列一下表达式 gcd(x,y)=z(z是素数而且x,y<=n). 然后我们能够得到什么呢? gcd(x/z,y/z)=1; 最好还是令y>=x 则能 ...
- fabric-ca安装
1.Go版本1.7+(具体可参考Linux安装Go语言) 2.GOPATH环境变量正确配置 export GOROOT=/usr/local/go export GOPATH=/opt/gopath ...
- ArrayList概述
一. ArrayList概述: ArrayList是基于数组实现的,是一个动态数组,其容量能自动增长,类似于C语言中的动态申请内存,动态增长内存. ArrayList不是线程安全的,只能用在单线程环境 ...
- Template Pattern
1.Template模式解决的问题:对于某一个业务逻辑在不同的对象中有不同的细节实现,但是逻辑的框架是相同的.将逻辑框架放在抽象基类中,并定义好细节的接口,子类中实现细节.Template模式利用多态 ...
- jps不显示java进程信息
本来想自己整理,发现已经有前人整理,并且完美解决了我的问题,故转载,感谢分享 转自:http://trinea.iteye.com/blog/1196400 对于jps较熟悉可以直接查看第二部分的分析 ...