题目链接:http://codeforces.com/contest/831/problem/B

题意:给第2个26个字母并不重复的字符串(2个字符串对于一个映射),第1个字符串为key集合,第2个字符串为对应的value集合。 然后给了一个字符串(包括小写字母和数字),按照映射规则输出结果(数字不变,字母则对照给定2个字符串的映射规则,大写字母先转换成对应小写字母然后映射完之后在转换成对应的大写字母)

思路:按照题目意思模拟即可。

#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<time.h>
#include<stack>
#include<cmath>
#include<functional>
#include<cstdlib>
using namespace std;
typedef long long int LL;
typedef unsigned long long int ULL;
const LL INF = 9223372036854775807L;
const int inf = 0x3f3f3f3f;
const int MAXN = + ;
char str[MAXN],zd[MAXN];
char c1[MAXN], c2[MAXN];
int main(){
#ifdef kirito
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
int start = clock();
while (~scanf("%s",c1)){
scanf("%s", c2);
scanf("%s", str);
for (int i = ; i < ; i++){
zd[c1[i] - 'a'] = c2[i];
}
for (int i = ; i < strlen(str); i++){
if (str[i] >= ''&&str[i] <= ''){
continue;
}
else if (str[i] >= 'A'&&str[i] <= 'Z'){
str[i] = (zd[str[i] - 'A'] - 'a' + 'A');
}
else{
str[i] = zd[str[i] - 'a'];
}
}
printf("%s\n", str);
}
#ifdef LOCAL_TIME
cout << "[Finished in " << clock() - start << " ms]" << endl;
#endif
return ;
}

Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - B的更多相关文章

  1. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)

    http://codeforces.com/contest/831 A. Unimodal Array time limit per test 1 second memory limit per te ...

  2. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem C (Codeforces 831C) - 暴力 - 二分法

    Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain ...

  3. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A,B,C

    A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: ...

  4. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem F (Codeforces 831F) - 数论 - 暴力

    题目传送门 传送门I 传送门II 传送门III 题目大意 求一个满足$d\sum_{i = 1}^{n} \left \lceil \frac{a_i}{d} \right \rceil - \sum ...

  5. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem D (Codeforces 831D) - 贪心 - 二分答案 - 动态规划

    There are n people and k keys on a straight line. Every person wants to get to the office which is l ...

  6. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 831E) - 线段树 - 树状数组

    Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this int ...

  7. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem A - B

    Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is cons ...

  8. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) A 水 B stl C stl D 暴力 E 树状数组

    A. Unimodal Array time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  9. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - D

    题目链接:http://codeforces.com/contest/831/problem/D 题意:在一个一维坐标里,有n个人,k把钥匙(钥匙出现的位置不会重复并且对应位置只有一把钥匙),和一个终 ...

  10. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - C

    题目链接:http://codeforces.com/contest/831/problem/C 题意:给定k个评委,n个中间结果. 假设参赛者初始分数为x,按顺序累加这k个评委的给分后得到k个结果, ...

随机推荐

  1. [BZOJ4817][SDOI2017]树点涂色:Link-Cut Tree+线段树

    分析 与[BZOJ3779]重组病毒唯一的区别是多了一个链上求实链段数的操作. 因为每条实链的颜色必然不相同且一条实链上不会有两个深度相同的点(好像算法的正确性和第二个条件没什么关系,算了算了),画图 ...

  2. PS4 Submission

    第一部分是param.sfo文件的设置: 另外,sce_sys目录下的icon0.png文件和pic1.png文件也可以手动修改成自己需要的样式,前者是在游戏中的logo,图片要求是512x512,p ...

  3. mysqldump常用使用

    1:导出数据库sakila的表结构mysqldump -uroot -ppwd -d sakila > /data/tmp/sakila.sql; 2:导出数据库sakila下表employee ...

  4. P1058立体图

    一道大模拟 思路: 首先是打表找规律时间 仔细思考(暴力手算)后推出这么一个数组: //宽的增加量 ]={,,,};//1竖着摞,2横着摞,3前后摞 //长的增加量 ]={,,,};//1竖着摞,2横 ...

  5. int 和 字节 相互转换

    In [10]: n = 0xf1f2 In [11]: bin(n) Out[11]: '0b1111000111110010' In [12]: n.bit_length() Out[12]: 1 ...

  6. 011-elasticsearch5.4.3【四】-聚合操作【二】-桶聚合【bucket】过滤、嵌套、反转、分组、排序、范围

    一.概述 bucketing(桶)聚合:划分不同的“桶”,将数据分配到不同的“桶”里.非常类似sql中的group语句的含义. metric既可以作用在整个数据集上,也可以作为bucketing的子聚 ...

  7. clientdataset 读取excel 如果excel 文件不存在的时候 相应的gird 会不显示数据, 鼠标掠过 gird 格子 才会显示数据。 这是一个bug 哈哈

    clientdataset 读取excel   如果excel 文件不存在的时候   相应的gird 会不显示数据, 鼠标掠过 gird 格子 才会显示数据.   这是一个bug 哈哈

  8. 龙珠MAD-视频列表(收集更新)

    博主最喜欢的动漫实际上就是龙珠.因此也喜欢收集或创作一些龙珠视频. 一些是一个分享列表.喜欢可以转载或收藏哦.(不定时持续更新) http://test.migucloud.com/vi0/360/3 ...

  9. JAVA AOP面向切面编程与动态代理

    1.静态代理和动态代理的概念:   在我的另一篇博文:Java 静态代理和动态代理 中有讲到,这里就不做赘述了. JDK动态代理它的好处理是可以为我们生成任何一个接口的代理类,并将需要增强的方法织入到 ...

  10. mac 添加mysql的环境变量和删除mysql

    添加环境变量 1.创建 .bash_profile,已创建过忽略这步 (1)启动终端 (2)进入当前用户的home目录(默认就是):         cd ~ 或 cd /Users/YourMacU ...