B. Lovely Palindromes

By | 07月25日
Advertisement

time limit per test
1 second

memory limit per test
256 megabytes

input
standard input

output
standard output

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.

Examples

input

1

output

11

input

10

output

1001

Note

The first 10 even-length palindrome numbers are 11, 22, 33, ...
, 88, 99 and 1001.

解题说明:此题就是字符串反转,直接调用库函数即可。

</pre><pre name="code" class="cpp">#include<cstdio>
#include <cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include <map>
using namespace std;

int main()
{
    char a[1000001];
    scanf("%s",a);
    printf("%s",a);
    strrev(a);
    printf("%s",a);
    return 0;
}

Similar Posts:

  • Palindromes

    http://acm.hdu.edu.cn/showproblem.php?pid=1318 Palindromes Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 787 Accepted Submission(s): 294 Problem Description A regular palindrome is a string of n

  • UVa 401 Palindromes

    Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is

  • CodeForces - 245H - Queries for Number of Palindromes

    先上题目: H. Queries for Number of Palindromes time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output You've got a string s = s1s2... s|s| of length |s|, consisting of lowercase English letters. Ther

  • hdu 1318 Palindromes(回文词)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1318 题意分析:输入每行包含一个字符串,判断此串是否为回文串或镜像串. 表面上看这道题有些复杂,如果能熟练运用字符数组的话,代码也颇为简洁.. /*Palindromes Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 657 Accepted

  • 回文串+回溯法 URAL 1635 Mnemonics and Palindromes

    题目传送门 1 /* 2 题意:给出一个长为n的仅由小写英文字母组成的字符串,求它的回文串划分的元素的最小个数,并按顺序输出此划分方案 3 回文串+回溯:dp[i] 表示前i+1个字符(从0开始)最少需要划分的数量,最大值是i+1,即单个回文串: 4 之前设置ok[j][j+i] 判断从j到j+i的字符是否为回文串(注意两个for的顺序,为满足ok[j][j+i] = ok[j+1][j+i-1]) 5 最后枚举找到最优划分点,用pre[i]记录前一个位置,print函数 输出空格 6 */ 7

  • HDOJ/HDU 2163 Palindromes(判断回文串~)

    Problem Description Write a program to determine whether a word is a palindrome. A palindrome is a sequence of characters that is identical to the string when the characters are placed in reverse order. For example, the following strings are palindro

  • USACO Section 1.2.5 [Dual Palindromes] Java题解

    题意分析: 这题和上一题基本是一样的,输出N个大于S的Dual Palindromes.其中N (1<=N<=15),S (0<S<10000).Dual Palindromes是能以二进制到十进制中两种进制表示成palindromic(左右对称)的数字. 解题思路: 十进制数与X进制数的转换. 代码实现: https://github.com/leonlu/USACOJavaSolution/blob/master/USACOSection1/src/dualpal.java

  • Palindromes - UVa 401 字符串处理

    Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is

  • hdu 2029 Palindromes _easy version (java)

    问题: 要牢记输入多行字符的方法.cin.nextLine();->string s=cin.nextLine(); 在处理for循环时,开始采用i>=j就停止的方式,并没有效果,后来改为i<=s.length()/2. Palindromes _easy version Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27177 A

  • CF 568A(Primes or Palindromes?-暴力判断)

    A. Primes or Palindromes? time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Rikhail Mubinchik believes that the current definition of prime numbers is obsolete as they are too complex and un

Tags: