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个数字都出现. 问序列有多少种可能. [题解] ...
随机推荐
- Linux CentOS-7.4-x86_64(原版) 百度网盘下载
因为CentOS-7-x86_64-DVD-1804.iso 镜像文件4.16G,超出了上传百度网盘的单个文件大小限制(4G), 所以这里先现将ISO镜像文件压缩成RAR包,然后上传网盘. 使用的话, ...
- 【C#技术】一篇文章搞掂:Infragistics组件库
工具栏 // 按钮不可按 tool.SharedProps.Enabled = false; Grid // Grid中记录时间 // 建议SQL Server中使用字符字段(没有深入测试,只是字符字 ...
- ios和android适配
一些情况下对非可点击元素如(label,span)监听click事件,ios下不会触发 解决方案:css增加cursor:pointer; 三星手机遮罩层下的input.select.a等元素可以被点 ...
- 安装纯净版debian!
kali更新了1.1.0a,不知道新版的内核哪地方有bug,用着用着就卡死了,一怒之下卸载了装debian. 下载的netinst只有200M,基本上就是刚好能用,不要用硬盘装,会找不到网卡,无线也没 ...
- Codechef March Cook-Off 2018. Maximum Tree Path
目录 题意 解析 AC_code @(Codechef March Cook-Off 2018. Maximum Tree Path) 题意 给你一颗\(n(1e5)\)个点有边权有点权的树,\(Mi ...
- python 比较俩个列表中的元素是否相同
如果元素都是数字: # a = [121, 144, 19, 161, 19, 144, 19, 11]# b = [121, 14641, 20736, 361, 25921, 361, 20736 ...
- HashCode方法整理
哈希表这个数据结构想必大多数人都不陌生,而且在很多地方都会利用到hash表来提高查找效率.在Java的Object类中有一个方法: 1 public native int hashCode(); 根据 ...
- Rsync 实现服务器文件的同步——服务端的安装配置
一.安装rsync 直接使用yum命令进行安装即可. yum -y install rsync 二.配置文件 网上大多教程都说安装是默认没有配置文件的,但是经过我的尝试,yum安装下默认是有配置文件的 ...
- 在Python中检测*可用* CPU数量的便携方式
根据这个问题和答案 - Python multiprocessing.cpu_count()在4核Nvidia Jetson TK1上返回'1' - Python multiprocessing.cp ...
- tar 和gzip 的区别
首先要 弄清两个概念:打包和压缩. 打包是指将一大堆文件或目录什么的变成一个总的文件, 压缩则是将一个大的文件通过一些压缩算法变成一个小文件. 为什么要区分这两个概念呢?其实这源于Linux中的很多压 ...