A. Palindromic Supersequence
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

You are given a string A. Find a string B, where B is a palindrome and A is a subsequence of B.

A subsequence of a string is a string that can be derived from it by deleting some (not necessarily consecutive) characters without changing the order of the remaining characters. For example, "cotst" is a subsequence of "contest".

A palindrome is a string that reads the same forward or backward.

The length of string B should be at most 104. It is guaranteed that there always exists such string.

You do not need to find the shortest answer, the only restriction is that the length of string B should not exceed 104.

Input

First line contains a string A (1 ≤ |A| ≤ 103) consisting of lowercase Latin letters, where |A| is a length of A.

Output

Output single line containing B consisting of only lowercase Latin letters. You do not need to find the shortest answer, the only restriction is that the length of string B should not exceed 104. If there are many possible B, print any of them.

Examples
input
aba
output
aba
input
ab
output
aabaa
Note

In the first example, "aba" is a subsequence of "aba" which is a palindrome.

In the second example, "ab" is a subsequence of "aabaa" which is a palindrome.

题目大意:已知a是b的一个子串,并且b是一个回文串,给定a,求任意一个b.

分析:把a正反输出一遍就好了.

#include <cstdio>
#include <cmath>
#include <queue>
#include <cstring>
#include <iostream>
#include <algorithm> using namespace std; typedef long long ll; char s[];
int len; int main()
{
scanf("%s",s + );
len = strlen(s + );
for (int i = ; i <= len; i++)
s[i + len] = s[len - i + ];
for (int i = ; i <= len * ; i++)
printf("%c",s[i]); return ;
}

Codeforces 932.A Palindromic Supersequence的更多相关文章

  1. Codeforces 932 A.Palindromic Supersequence (ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined))

    占坑,明天写,想把D补出来一起写.2/20/2018 11:17:00 PM ----------------------------------------------------------我是分 ...

  2. 【ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A】 Palindromic Supersequence

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 字符串倒着加到原串右边就好 [代码] #include <bits/stdc++.h> using namespace ...

  3. Codeforces 932 E. Team Work(组合数学)

    http://codeforces.com/contest/932/problem/E 题意:   可以看做 有n种小球,每种小球有无限个,先从中选出x种,再在这x种小球中任选k个小球的方案数 选出的 ...

  4. Codeforces 932.F Escape Through Leaf

    F. Escape Through Leaf time limit per test 3 seconds memory limit per test 256 megabytes input stand ...

  5. Codeforces 932.E Team Work

    E. Team Work time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  6. Codeforces 932.D Tree

    D. Tree time limit per test 2 seconds memory limit per test 512 megabytes input standard input outpu ...

  7. 【CodeForces】835D Palindromic characteristics

    [题意]给你一个串,让你求出k阶回文子串有多少个.k从1到n.k阶子串的定义是:子串本身是回文串,而且它的左半部分也是回文串. [算法]区间DP [题解]涉及回文问题的区间DP都可以用类似的写法,就是 ...

  8. Codeforces 932.C Permutation Cycle

    C. Permutation Cycle time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  9. Codeforces 932.B Recursive Queries

    B. Recursive Queries time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

随机推荐

  1. 用Java读取xml文件内容

     在AXP中,DOM解析器是1 Document Builder类的一个实例,该实例由 DocumenBailderfactorv类负责创,步如下  DocumentBuilderFactory fa ...

  2. 使用Jmeter性能测试,读取csv文件时的乱码问题

    读取csv参数乱码问题 发送请求时参数通过CSV文件读取,发送请求后显示错误,把获取的参数通过在线urlencode转码器转码后发现是乱码.打开csv设值,编码格式选择的是UTF-8,打开参数文件后发 ...

  3. IDEA 编辑框光标闪烁

    依次打开如下菜单: File -> Settings -> Editor -> General -> Appearance -> 选中 Caret blinking (m ...

  4. xml解析之stax

    博文引自:http://zangweiren.iteye.com/blog/647334 Java 6.0对XML支持的新特性有许多方面.比如StAX.针对XML-Web服务的Java架构(JAX-W ...

  5. 40.VUE学习之--组件之间的数据传参父组件向子组件里传参,props的使用实例操作

    父组件向子组件里传参,props的使用实例 <!DOCTYPE html> <html> <head> <meta charset="utf-8&q ...

  6. foreachRDD,foreach,foreachPartition区别联系

    foreachRDD(SparkStreaming): SparkStreaming是流式实时处理数据,就是将数据流按照定义的时间进行分割(就是"批处理").每一个时间段内处理到的 ...

  7. iOS常用控件-UITableViewCell

    一. 封装cell: 1.加载xib文件的两种方式 <方式1> (NewsCell是xib文件的名称) NSArray *objects = [[NSBundle mainBundle] ...

  8. filter() 函数的使用

    Python3 filter() 函数 描述 filter() 函数用于过滤序列,过滤掉不符合条件的元素,返回一个迭代器对象,如果要转换为列表,可以使用 list() 来转换. 该接收两个参数,第一个 ...

  9. 常用 Git 命令清单【转--阮一峰】

    常用 Git 命令清单 感谢作者 --> 原文链接 我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下 ...

  10. 笔记-python操作mysql

    笔记-python操作mysql 1.      开始 1.1.    环境准备-mysql create database db_python; use db_python; create tabl ...