简单模拟~

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+;
int a[maxn];
unordered_map<char,int> pos;
string s="_abcdefghijklmnopqrstuvwxyz.";
int len;
char ch[maxn];
int main () {
for (int i=;i<;i++)pos[s[i]]=i;
int n;
while (scanf("%d",&n)&&n) {
scanf("%s",ch);
len=strlen(ch);
for (int i=;i<len;i++) a[n*i%len]=(pos[ch[i]]+i)%;
for (int i=;i<len;i++) printf ("%c",s[a[i]]);
printf ("\n");
}
return ;
}

ZOJ1006 Do the Untwist的更多相关文章

  1. 1006 Do the Untwist

    考察编程基础知识,用到字符和数字相互转化等.形式是描述清楚明文和暗文的转化规则. #include <stdio.h> #include <string.h> #define ...

  2. ZOJ 1006:Do the Untwist(模拟)

    Do the Untwist Time Limit: 2 Seconds      Memory Limit: 65536 KB Cryptography deals with methods of ...

  3. Do the Untwist(模拟)

    ZOJ Problem Set - 1006 Do the Untwist Time Limit: 2 Seconds      Memory Limit: 65536 KB Cryptography ...

  4. Do the Untwist

      Do the Untwist Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  5. ZOJ Problem Set - 1006 Do the Untwist

    今天在ZOJ上做了道很简单的题目是关于加密解密问题的,此题的关键点就在于求余的逆运算: 比如假设都是正整数 A=(B-C)%D 则 B - C = D*n + A 其中 A < D 移项 B = ...

  6. [ZOJ 1006] Do the Untwist (模拟实现解密)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=6 题目大意:给你加密方式,请你求出解密. 直接逆运算搞,用到同余定理 ...

  7. ACM/ICPC ZOJ1006-Do the Untwist 解题代码

    #include <iostream> #include <string> #include <stdlib.h> using namespace std; int ...

  8. 杭电ACM分类

    杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...

  9. OJ题目分类

    POJ题目分类 | POJ题目分类 | HDU题目分类 | ZOJ题目分类 | SOJ题目分类 | HOJ题目分类 | FOJ题目分类 | 模拟题: POJ1006 POJ1008 POJ1013 P ...

随机推荐

  1. js判断有无属性及新添属性

    1.Object 判断有无新属性 obj.hasOwnProperty(propertyName)  //有无指定属性propertyName        Object.keys(obj)      ...

  2. Hibernate:HIbernate配置详解-HelloWorld

    hibernate介绍: Hibernate是一个开源的对象关系映射框架,它对JDBC进行了轻量级的对象封装,使Java程序员可以随心所欲的使用对象编程思维来操纵数据库. 它不仅提供了从java类到数 ...

  3. bootstrap中响应式表格失灵

    当宽度小于768px,由于表格的内容不能填充到出现横向滚动条 单元格内容不够: 出现横向滚动条

  4. Ubuntu 安装 k8s 三驾马车 kubelet kubeadm kubectl

    Ubuntu 版本是 18.04 ,用的是阿里云服务器,记录一下自己实际安装过程的操作步骤. 安装 docker 安装所需的软件 apt-get update apt-get install -y a ...

  5. n个点的最长公共子串(别人的模板) poj 3080

    没有理解代码.单纯记模板 题意:找最长的公共字串,长度相同就找字典序最小的(这一点wa了我13遍!!!)题解:kmp或者直接暴力列举当公共子串长度小于3时,有特判 #include<map> ...

  6. [LeetCode]1.Two Sum 两数之和&&第一次刷题感想

    ---恢复内容开始--- 参考博客: https://www.cnblogs.com/grandyang/p/4130379.html https://blog.csdn.net/weixin_387 ...

  7. 动手实现CapsNet系列——2 实现(未完待续)

    执行后返回如下信息: Loading complete. Training started! [epoch 0][iter 0] loss: 0.8082, acc: 14.0000% (14/100 ...

  8. Atcoder Beginner Contest153E(完全背包)

    完全背包,价值取题意代价的最小值 #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ],b ...

  9. nginx配置 yii2 URL重写规则 SSI配置使shtml

    location / { // 加上红色部分 重写url try_files $uri $uri/ /index.php?$args; if (!-e $request_filename){ rewr ...

  10. 用Fiddler实现手机抓包

    手机用fiddler抓包 电脑最好是笔记本,这样能和手机保持统一局域网内:其他不多说,直接说步骤了. 一.对PC(笔记本)参数进行配置    1. 配置fiddler允许监听到https(fiddle ...