Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - B
题目链接: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的更多相关文章
- 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 ...
- 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 ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals)A,B,C
A:链接:http://codeforces.com/contest/831/problem/A 解题思路: 从前往后分别统计递增,相等,递减序列的长度,如果最后长度和原序列长度相等那么就输出yes: ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - D
题目链接:http://codeforces.com/contest/831/problem/D 题意:在一个一维坐标里,有n个人,k把钥匙(钥匙出现的位置不会重复并且对应位置只有一把钥匙),和一个终 ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) - C
题目链接:http://codeforces.com/contest/831/problem/C 题意:给定k个评委,n个中间结果. 假设参赛者初始分数为x,按顺序累加这k个评委的给分后得到k个结果, ...
随机推荐
- jsoncpp 能做什么
jsoncpp能做什么1)跨平台跨语言动态信息数据交换.2)作为格式化配置文件使用3)对应数据结构数据类型做序列化和反序列化4)value::toStyledString 格式化json串输出 一.w ...
- windows编程,消息函数中拦截消息的问题
很多年没有写windows窗口程序了,今天自制基于vulkan的程序时遇到了一些问题,部分代码如下: LRESULT CALLBACK XWindow::WndProc(HWND hWnd, UINT ...
- linux sed 替换,使用变量,变量中含有特殊字符的处理
文件 test.sh 内容如下: #!/bin/bash export JAVA_HOME=/data/jdk_1.9.0 echo $JAVA_HOME 想把 JAVA_HOME = 后面的内容替换 ...
- base64加密小案例
python终端下: import base64 >>> dict='{"name":"tom"}' >>> dict.en ...
- Delphi XE2 之 FireMonkey 入门(23) - 数据绑定: TBindingsList: TBindExpression
准备用 TBindingsList 重做上一个例子. 可以先把 TBindingsList 理解为是一组绑定表达式(TBindExpression)的集合;官方应该是提倡在设计时完成 TBindExp ...
- [转载]OpenSSL中文手册之命令行详解(未完待续)
声明:OpenSSL之命令行详解是根据卢队长发布在https://blog.csdn.net/as3luyuan123/article/details/16105475的系列文章整理修改而成,我自己 ...
- 读取资源中的GIF文件相应像素宽高度
代码参考了如下网页的实现: https://www.cnblogs.com/zy791976083/p/9921069.html 整理成一个函数: BOOL GetResGifSize(long nR ...
- Python解决ModuleNotFoundError: No module named 'Queue'的问题
我们知道Python2和Python3两个版本之间,有些不兼容的地方,Python3中引入Queue会报出这个问题. Python3中要这样引入: import queue Python2中要这样引入 ...
- windows 10上玩耍ubuntu
win10 已经支持运行子系统ubuntu了. 安装ubuntu 程序和功能>>启用或关闭Windows功能>>勾选"适用于Linux的Windows子系统" ...
- [9期]软WAF上传绕过+webshell免杀
安全狗上传绕过 思路: 1.扰乱编码 form-data 替换成 ~form-data form-data 改成 f+orm-data form-data 改成 for ...