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个数字都出现. 问序列有多少种可能. [题解] ...
随机推荐
- CKEditor的使用经历总结
关于ckeditor的下载和引用网上有很多完整清晰的教程,就不在此多说了,主要说一些小问题. 这个插件,初次用的时候放不进背景图,放不进隐藏域,连class,id这些属性都放不进去,然后我进行了一些调 ...
- vue之slot用法
slot元素作为组件模板之中的内容分发插槽.这个元素自身将被替换. 有 name 特性的 slot 称为具名 slot. 有 slot 特性的内容将分发到名字相匹配的具名 slot. 一.单个组件 如 ...
- find pattern
daniel@daniel-mint ~/msf/metasploit-framework/tools $ ruby pattern_create.rb 2000 Aa0Aa1Aa2Aa3Aa4Aa5 ...
- upc组队赛4 TV Show Game 【2-SAT】
TV Show Game 题目描述 Mr. Dajuda, who is famous for a TV show program, occasionally suggests an interest ...
- \r\n\t 转义字符
https://www.cnblogs.com/lsqbk/p/10259044.html https://www.cnblogs.com/f158w058/p/6548073.html 文件中的换行 ...
- java部署:CentOS 7下Tomcat安装与配置教程(Tomcat开机启动)
一.前言 1.本教程主要内容 Tomcat安装与基础配置 Tomcat开机启动配置 2.本教程适用范围与环境信息 适用范围 软件/工具 版本说明 CentOS CentOS 7 Tomcat Tomc ...
- 【linux】centos6/7 + nginx 利用certbot 申请https证书
没错我又踩坑了.昨晚上搞到十二点半才成功申请.鬼知道OJ服务器是个什么渣渣. 早上才算正式弄好,中间也学了不少东西,记录一下.这次是http转https,所以默认的还是只有80端口. 请务必确保自己的 ...
- 将rdlc报表作为资源嵌套使用
原文:将rdlc报表作为资源嵌套使用 如果我们准备在Windows Forms里面使用rdlc报表,那么会遇到一个问题:rdlc报表到底要不要作为附属文件的方式随程序发布? 这样做的优点是:报表可以后 ...
- servlet的ServletContext接口
ServletContext Servlet 上下文 每个web工程都只有一个ServletContext对象,也就是不管在哪个servlet里面,获取到的这个ServletContext对象都是同一 ...
- 【转载】vue-cli搭建的环境,用nginx做代理服务器,访问时显示:Invalid Host header
来源:https://blog.csdn.net/Cookysurongbin/article/details/86077241 vue-cli搭建的环境,用nginx做代理服务器,访问时显示:Inv ...