305749: CF1085A. Right-Left Cipher
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Right-Left Cipher
题意翻译
## 题目描述 Polycarp喜欢密码。 他发明了自己的密码,称为“右-左”(?应该是这个意思吧?)。 “右-左”密码用于加密字符串。 Polycarp使用以下算法加密字符串,$S = S_1S_2S_3 ... S_n$: 他写下$S_1$,他用$S_2$接上当前的单词(即将$S_2$写到当前结果的右边), 他在$S_3$前面加上当前的单词(即在当前结果的左边写下$S_3$), 他将$S_4$接上当前单词(即将$S_4$写到当前结果的右侧), 他在$S_5$前面加上当前的单词(即在当前结果的左边写下$S_5$)... 这么做直到处理完$S$。 举个例子,如果$S = $"techno",那么处理过程就是: "t" → "te" → "cte" → "cteh" → "ncteh" → "ncteho"。所以加密"techno"后的字符串就是"ncteho"。 现在给你一个字符串$t$,即加密后的字符串,你的任务就是找到原来的字符串$S$ ## 输入输出格式 ### 输入格式: 只有一行,$t$,加密后的字符串,只包含小写字母,$1<= t_{len} <=50$ ### 输出格式: 一行,原字符串$S$。题目描述
Polycarp loves ciphers. He has invented his own cipher called Right-Left. Right-Left cipher is used for strings. To encrypt the string $ s=s_{1}s_{2} \dots s_{n} $ Polycarp uses the following algorithm: - he writes down $ s_1 $ , - he appends the current word with $ s_2 $ (i.e. writes down $ s_2 $ to the right of the current result), - he prepends the current word with $ s_3 $ (i.e. writes down $ s_3 $ to the left of the current result), - he appends the current word with $ s_4 $ (i.e. writes down $ s_4 $ to the right of the current result), - he prepends the current word with $ s_5 $ (i.e. writes down $ s_5 $ to the left of the current result), - and so on for each position until the end of $ s $ . For example, if $ s $ ="techno" the process is: "t" $ \to $ "te" $ \to $ "cte" $ \to $ "cteh" $ \to $ "ncteh" $ \to $ "ncteho". So the encrypted $ s $ ="techno" is "ncteho". Given string $ t $ — the result of encryption of some string $ s $ . Your task is to decrypt it, i.e. find the string $ s $ .输入输出格式
输入格式
The only line of the input contains $ t $ — the result of encryption of some string $ s $ . It contains only lowercase Latin letters. The length of $ t $ is between $ 1 $ and $ 50 $ , inclusive.
输出格式
Print such string $ s $ that after encryption it equals $ t $ .
输入输出样例
输入样例 #1
ncteho
输出样例 #1
techno
输入样例 #2
erfdcoeocs
输出样例 #2
codeforces
输入样例 #3
z
输出样例 #3
z