Codeforces gym102222 C. Caesar Cipher 签到
题意:
给定一对用凯撒密码加密的明文和密文,再给你一个密文,让你解密出明文,保证有唯一解。
题解:
对凯撒密码的已知明文攻击,签到题。
#include<iostream>
using namespace std;
char c1[],c2[],c3[];
int t;
int main(){
int __;
scanf("%d",&__);
for(int _=;_<=__;_++){
int n,m;
scanf("%d %d",&n,&m);
scanf("%s %s",c1,c2);
t=(c1[]-c2[]+)%;
scanf("%s",c3);
printf("Case #%d: ",_);
for(int i=;i<m;i++){
printf("%c",(c3[i]-'A'+t)%+'A');
}
printf("\n");
}
return ;
}
Codeforces gym102222 C. Caesar Cipher 签到的更多相关文章
- 2018 ACM-ICPC 宁夏 C.Caesar Cipher(模拟)
In cryptography, a Caesar cipher, also known as the shift cipher, is one of the most straightforward ...
- Codeforces - 102222C - Caesar Cipher
https://codeforc.es/gym/102222/my 好像在哪里见过这个东西?字符的左右移还是小心,注意在mod26范围内. #include<bits/stdc++.h> ...
- Codeforces Round #528-A. Right-Left Cipher(字符串模拟)
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- Codeforces 118 D. Caesar's Legions (dp)
题目链接:http://codeforces.com/contest/118/problem/D 有n个步兵和m个骑兵要排成一排,其中连续的步兵不能超过k1个,连续的骑兵不能超过k2个. dp[i][ ...
- codeforces 897A Scarborough Fair 暴力签到
codeforces 897A Scarborough Fair 题目链接: http://codeforces.com/problemset/problem/897/A 思路: 暴力大法好 代码: ...
- Codeforces 1090M - The Pleasant Walk - [签到水题][2018-2019 Russia Open High School Programming Contest Problem M]
题目链接:https://codeforces.com/contest/1090/problem/M There are n houses along the road where Anya live ...
- Caesar cipher
#include <iostream> using namespace std; int main() {int k,i; char s[5]; cin>>k; for(; ...
- The 2018 ACM-ICPC Chinese Collegiate Programming Contest Caesar Cipher
#include <iostream> #include <cstdio> #include <cstring> #include <string> # ...
- 【Codeforces 118B】Caesar's Legions
[链接] 我是链接,点我呀:) [题意] 序列中不能连续出现k1个以上的1以及不能连续出现k2个以上的2,然后一共有n1个1以及n2和2,要求这n1+n2个数字都出现. 问序列有多少种可能. [题解] ...
随机推荐
- vue基础八
表单控件绑定 1.基础用法 你可以用 v-model 指令在表单控件元素上创建双向数据绑定.尽管有些神奇,但 v-model 本质上不过是语法糖,它负责监听用户的输入事件以更新数据,并特别处理一些极端 ...
- Cisco基础(六):配置目前网络环境、项目阶段练习
一.配置目前网络环境 目标: 一家新创建的IT公司,公司位于北京有80多台服务器 目前网络环境使用技术,通过端口映射技术将web服务器发布给Internet: 三层交换:汇聚接入层交换机 默认路由:实 ...
- Redis缓存接入监控、运维平台CacheCloud
改造RedisConnectionFactory /** * 根据缓存策略的不同,RedisConnectionFactory不同 * 示例是单机模式. * * @return */@Beanpubl ...
- 【Tomcat】2.配置Tomcat服务器端口和HTTPS
1.修改XML配置文件 找到Tomcat安装目录下的conf文件夹,打开server.xml文件(可以用笔记本打开) 其中有几行代码如下 <Server port="8005" ...
- 再次安装双linux系统及kali的grub修复!
打算下学期不带笔记本,平时编程上网本就够了,也就看看一般的算法,于是那上网本装centos7和kali,上网本是APU,但是这两个版本的linux都支持的不错. 先安装centos,由于熟悉了linu ...
- python json格式参数遍历所有key、value 及替换key对于的value
1.对于接口自动化测试,一般接口以json形式发送返回,往往我们就需要遍历json文件中所有key,value以及修改替换key对于的value. 例如json发送/接收的文件: SendRegist ...
- ES6数组方法
ES6数组方法 以下方法添加到了Array.prototype对象上(isArray除外) indexOf 类似字符串的indexOf()方法 stringObject.indexOf(searchv ...
- Loadrunner test web service which need username and password
Action(){ char * position; char * str; int offset; char * search_str = "ERROR"; // web_s ...
- 使用yarn搭建vue项目
今天尝试了一下用yarn的方式搭建vue项目,方法其实是和npm的用法一样.但是在创建过程中报错了.现在整理一下,便于后期查错时使用. 以windows系统为例 1.全局安装yarn,三种方式 官网上 ...
- Zabbix Server 和 Zabbix Agentd 开机自动运行
Zabbix Server 和 Zabbix Agentd 开机自动运行 请问:怎样 Zabbix Server 和 Zabbix Agentd 开机自动运行? 注:如果你的命令行写进了 /etc/r ...