NC221563. MikawithEncryption
描述
输入描述
A string after encrypting, which length is even and less than .
It is guaranteed that the string only consists upper or lower letters.
输出描述
Output one line which represents the string before encrypting.
示例1
输入:
GLouocdk
输出:
GoodLuck
C++(clang++11) 解法, 执行用时: 4ms, 内存消耗: 400K, 提交时间: 2021-05-08 12:36:08
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int n=s.size(); for(int i=0;i<n;i+=2) cout<<s[i]; for(int i=1;i<n;i+=2) cout<<s[i]; }
Python3 解法, 执行用时: 40ms, 内存消耗: 7088K, 提交时间: 2021-09-10 14:59:03
a=input() b=a[::2]+a[1::2] print(b)
pypy3(pypy3.6.1) 解法, 执行用时: 48ms, 内存消耗: 18676K, 提交时间: 2021-05-08 12:34:01
s = input() print(s[::2] + s[1::2])