http://codeforces.com/problemset/problem/688/B

B. Lovely Palindromes
time limit per test

1 second

memory limit per test

256 megabytes

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.

题意:找第n个偶数位数的对称数字。

思路:逻辑分析题。只看数字的一半(因为是偶数位数),它的一半是n,则它就是第n个符合要求的数。

代码:

 #include <iostream>
#include <cstring>
using namespace std; #define n 100005 int main ()
{
char s[n];
cin >> s;
int len = strlen(s);
for (int i = ; i < len; i++)
{
cout << s[i];
}
for (int i = len - ; i >= ; i--)
{
cout << s[i];
}
cout << endl;
return ;
}

cf688B-Lovely Palindromes的更多相关文章

  1. CF688B Lovely Palindromes 题解

    Content 输入一个数 \(n\),输出第 \(n\) 个偶数位回文数. 数据范围:\(1\leqslant n\leqslant 10^{10^5}\). Solution 一看这吓人的数据范围 ...

  2. Codeforces Round #360 (Div. 2) B. Lovely Palindromes 水题

    B. Lovely Palindromes 题目连接: http://www.codeforces.com/contest/688/problem/B Description Pari has a f ...

  3. codeforces 688B B. Lovely Palindromes(水题)

    题目链接: B. Lovely Palindromes time limit per test 1 second memory limit per test 256 megabytes input s ...

  4. CodeForces 688B Lovely Palindromes (水题回文)

    题意:给一个数n,让你找出长度为偶数,并且是第 n 个回文数. 析:你多写几个就知道了,其实就是 n,然后再加上n的逆序,不过n有点大,直接用string 好了. 代码如下: #include < ...

  5. E - Lovely Palindromes

    Description Pari has a friend who loves palindrome numbers. A palindrome number is a number that rea ...

  6. 套题 codeforces 360

    A题:Opponents 直接模拟 #include <bits/stdc++.h> using namespace std; ]; int main() { int n,k; while ...

  7. 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 ...

  8. hdu 1318 Palindromes

    Palindromes Time Limit:3000MS     Memory Limit:0KB     64bit                                         ...

  9. dp --- Codeforces 245H :Queries for Number of Palindromes

    Queries for Number of Palindromes Problem's Link:   http://codeforces.com/problemset/problem/245/H M ...

随机推荐

  1. 初学者的Node.js学习历程

    废话篇: 对于我这个新手的不能再白菜的人来说,nodejs的大名都有耳闻,所以说他是一项不可不克服的技能也是可以说的.但是之前没有搞清楚的情况之下胡乱的猜测,是的我对node.js没有一个具体的概念的 ...

  2. Hash Join 一定是选择小表作为驱动表吗

    原来自己也是一直认为oralce会选择小表作为驱动表,以前一直也没注意,今天看了落落大神的实验,才发现,oralce查询时不一定选择小表作为驱动表. 如果对大表增加了约束,大表也会作为驱动表. 实验见 ...

  3. MySQL多种安装方式选择

    1.rpm包安装方式 rpm包的安装方式非常简单,这里以el6平台下的mysql-5.6.34版本为例,首先,要通过上述搜狐镜像地址下载到如下四个MySQL相关软件安装包. a.下载安装包 MySQL ...

  4. 自动部署基于Maven的war文件到远程Tomcat

    转载自:https://www.cnblogs.com/jtlgb/p/7018705.html Tomcat 7发布URL = http://localhost:8080/manager/text命 ...

  5. loj #6247. 九个太阳

    求 $\sum\limits_{i=1}^n [k | i] \times C_n^i$ 膜 $998244353$ $n \leq 10^{15},k \leq 2^{20}$ $k$ 是 $2$ ...

  6. .net remoting和wcf自托管——一个bug引发的警示

    一.解决问题,需要深入,并从细节入手,多从代码找原因,不能认为代码是死的,不会出错: 之前代码都运行良好,突然某一天,在我电脑上出问题了.出了问题,那就应该找出原因.其实这个问题,本身并不难,好歹给你 ...

  7. Storm实时计算:流操作入门编程实践

    转自:http://shiyanjun.cn/archives/977.html Storm实时计算:流操作入门编程实践   Storm是一个分布式是实时计算系统,它设计了一种对流和计算的抽象,概念比 ...

  8. axios 请求报错

    报错如下: 解决:axios的请求配置中的baseURL配置错误,修改好即可. 报错前: baseURL: "192.168.30.220:3000", 解决后:baseURL: ...

  9. 清理svn.bat

     @echo on  color 2f  mode con: cols=80 lines=25  @REM  @echo 正在清理SVN文件,请稍候......  @rem 循环删除当前目录及子目录下 ...

  10. (转载)Windows: "net use" command introduction

    1)建立空连接: net use ""IP"ipc$ "" /user:"" (一定要注意:这一行命令中包含了3个空格) 2)建立 ...