占坑,明天写,想把D补出来一起写。2/20/2018 11:17:00 PM

----------------------------------------------------------我是分割线-------------------------------------------------------

我来了,本来打算D题写到一起的,但是有新的东西要写,D就单独写一篇,这里写A,B,C;

开启智障模式:(看我咸鱼突刺的厉害( • ̀ω•́ )✧)   2/21/2018 10:46:00 PM

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.

这道题完全直接就OK,emnnn,哈哈哈,直接倒着再来一遍就可以。

代码:

 //A. Palindromic Supersequence-水题
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn=+;
char a[maxn],b[*maxn];
int main(){
while(~scanf("%s",a)){
memset(b,,sizeof(b));
int len=strlen(a);
int h=;
for(int i=;i<len;i++)
b[h++]=a[i];
for(int i=len-;i>=;i--)
b[h++]=a[i];
printf("%s\n",b);
}
return ;
}

Codeforces 932 A.Palindromic Supersequence (ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined))的更多相关文章

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

    2018-02-19 A. Palindromic Supersequence time limit per test 2 seconds memory limit per test 256 mega ...

  2. Codeforces 932.A Palindromic Supersequence

    A. Palindromic Supersequence time limit per test 2 seconds memory limit per test 256 megabytes input ...

  3. ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined)

    靠这把上了蓝 A. Palindromic Supersequence time limit per test 2 seconds memory limit per test 256 megabyte ...

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

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

  5. Codeforces 932 C.Permutation Cycle-数学 (ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined))

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

  6. Codeforces 932 B.Recursive Queries-前缀和 (ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined))

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

  7. 【ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) D】Tree

    [链接] 我是链接,点我呀:) [题意] 让你在树上找一个序列. 这个序列中a[1]=R 然后a[2],a[3]..a[d]它们满足a[2]是a[1]的祖先,a[3]是a[2]的祖先... 且w[a[ ...

  8. 【ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) C】 Permutation Cycle

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] p[i] = p[p[i]]一直进行下去 在1..n的排列下肯定会回到原位置的. 即最后会形成若干个环. g[i]显然等于那个环的大 ...

  9. 【ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) B】Recursive Queries

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 写个记忆化搜索. 接近O(n)的复杂度吧 [代码] #include <bits/stdc++.h> using nam ...

随机推荐

  1. 【laravel】Laravel 5 TokenMismatchException on PHP 5.6.9

    When I realized this was only happening in IE and Chrome, but not Firefox, it led me to the fix. The ...

  2. graph-basic

    打算使用STL中的vector,通过邻接链表的方式存储图.这里贴基本定义,以及depth-first-search和breadth-first-search的实现代码. 其他图的算法实现,就贴在各自的 ...

  3. Cinder配置多Ceph后端步骤

    1. 检查cinder当前backend配置 使用cinder service-list,查看cinder-volume服务的Host字段格式. 旧版格式: 新版格式: 旧版中Host字段是cinde ...

  4. debian使用ibus

    $ sudo apt-get install ibus ibus-pinyin 点击右上角的键盘图标,设置拼音输入法

  5. mac 安装composer的方法

    打开命令后 cd /usr/local/bin 然后执行 curl -sS https://getcomposer.org/installer | php 接下来 sudo mv composer.p ...

  6. 哪里是Maven的中央存储库?

    当你建立了一个Maven工程,Maven会检查你的pom.xml文件,确定要下载的依赖.首先,Maven将从您的本地库Maven查找,如果没有找到,Maven会从中央存储库-http://repo1. ...

  7. 写iOS SDK注意事项

    转载http://www.devtang.com/blog/2015/01/31/write-sdk-tips/

  8. 使用百度siteapp开发网站的App-(IOS和Android版本)

    介绍 之前写了个把百度云作文网站文件服务器.一些园友的评论不错.不过我似乎把意思弄错了!  我用的百度云的SVN环境! 现在不少人都做web开发.不管你是什么语言编写的(jsp,php,asp.net ...

  9. 不可取代的网站开发工具---------dreamweaver

    现在web开发的工具越来越多,sublime text,webstorm等web开发工具日益崛起,一直威胁着当年网页三剑客之一的dreamweaver工具的地位,然而dreamweaver却是无法取代 ...

  10. PHP mac xdebug配置

    PHP实现断点调试的条件 1. 需要PHP安装xdebug扩展 2. 修改PHP配置文件,开启xdebug扩展,并且对xdebug进行一些配置 3. 重启服务器如apach或nginx 4. 编译器配 ...