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个结果, ...
随机推荐
- Move Controller UE4键位
工作中需要,就总结了一下,如下图:
- httpscan 爬虫式的网段Web主机发现小工具
httpscan是一个扫描指定网段的Web主机的小工具.和端口扫描器不一样,httpscan是以爬虫的方式进行Web主机发现,因此相对来说不容易被防火墙拦截.httpscan会返回IP http状态码 ...
- es之java分页操作
按照一般的查询流程来说,如果我想查询前10条数据: · 1 客户端请求发给某个节点 · 2 节点转发给个个分片,查询每个分片上的前10条 · 3 结果返回给节点,整合数据,提取前10条 · 4 返回给 ...
- PHP会话
B/S请求响应模式是无状态的.任意的请求间不存在任何的联系,不能将请求状态保持下去. 会话技术可以给每个浏览器分配持久数据,这些数据不会随着一次请求和相应结束而销毁. COOKIE cookie是一种 ...
- 搭建python-flask开发环境
ubuntu环境 1. 更新系统软件源: 没有通过更新系统软件源的话,可能无法通过apt-get install安装我们需要用到的软件: $ sudo apt-get update $ sudo ap ...
- 011-elasticsearch5.4.3【四】-聚合操作【二】-桶聚合【bucket】过滤、嵌套、反转、分组、排序、范围
一.概述 bucketing(桶)聚合:划分不同的“桶”,将数据分配到不同的“桶”里.非常类似sql中的group语句的含义. metric既可以作用在整个数据集上,也可以作为bucketing的子聚 ...
- 关于 token
用户在浏览器做一系列操作,后台服务怎么判断这些操作是来自同一个用户? 1. seesion 用户登录后,后台生成 sessionid 返回给浏览器,浏览器的每次请求带上 sessionid,后台关联 ...
- 阶段1 语言基础+高级_1-3-Java语言高级_1-常用API_1_第8节 Math类_19_Math练习:小学数学真题
题目 画数轴 解题思路 强转成int类型就会舍弃小数位数 输出最终的数量 如果用Math.ceil的方式的话
- 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_04 IO字节流_12_练习_文件复制
谁用字节可以读取任何文件. 读取后再写入到D盘去.这就是一个文件的复制. 怎么由C盘到D盘.这里要借助流技术 需要创建两个流,一个读取一个写入 图片复制过来了. 看一下图片的字节数.whilte循环要 ...
- MySQL 修改密码,
ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin';