题目链接: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. Web开发者易犯的五大严重错误

    无论你是编程高手,还是技术爱好者,在进行Web开发过程中,总避免不了犯各种各样的错误. 犯了错误,可以改正.但如果犯了某些错误,则会带来重大损失.遗憾.令人惊讶的是,这些错误往往是最普通,最容易避免. ...

  2. 查看windosw服务器型号和序列号

    查看服务器型号 wmic csproduct get name 查看序列号 wmic bios get serialnumber 查看内存 wmic memorychip list brief === ...

  3. ARM非对齐访问和Alignment Fault

    1.指令对齐 A64指令必须word对齐.尝试在非对齐地址取值会触发PC alignment fault. 1.1.PC alignment checking PC(Program Counter)寄 ...

  4. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_04 IO字节流_4_字节输出流写入数据到文件

    数据由内存写入到硬盘中 构造函数传的路径是一个相对路径.有异常需要捕获异常 释放资源 这三个方法,都有异常 IO异常是父类,所以这里只需要抛出IO异常就可以了. 运行程序.目录内多了个a.txt文件 ...

  5. 类Thread

    public final void join() throws InterruptedException /* * public final void join() * throws Interrup ...

  6. 【HANA系列】SAP HANA启动出现ERROR

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA启动出现ERRO ...

  7. Java-XML解析第一篇主流开源类库解析XML

    1.流行的XML解析框架 1>底层解析方式:存在编码复杂性.难扩展.难复用.....想了解底层解析方式请参考:浅谈 Java XML 底层解析方式 2>Dom4j:基于 JAXP 解析方式 ...

  8. using 用法拾忆

    using 用法主要包括三种: 1.引用外部命名空间以及外部命名空间中定义的类型(指令) 2.创建命名空间别名,避免因名称相同造成的冲突(指令) 3.定义资源使用范围,在范围结束后释放资源对象(语句) ...

  9. node基本介绍及使用

    1.什么是node 简单的说node.js就是运行在服务端的JavaScript 官网地址:http://nodejs.cn/ 2.node安装 2.1下载node node下载:https://no ...

  10. 使用内核LED框架搭建驱动 ——led_classdev_register

    #include <linux/init.h> // __init __exit #include <linux/module.h> // module_init module ...