hdu-1129(模拟题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1129
注意:c_code[i]=(p_code[i*k%n]-i)%28;
#include<iostream>
#include<cstring>
#include<cstdio>
#include<map>
using namespace std;
char dc[]={'_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z','.'};
map <char,int> mp;
char str[];
int pcode[],ccode[];
int main(void)
{
mp['_']=;mp['a']=;mp['b']=;mp['c']=;mp['d']=;mp['e']=;mp['f']=;mp['g']=;mp['h']=;mp['i']=;
mp['j']=;mp['k']=;mp['l']=;mp['m']=;mp['n']=;mp['o']=;mp['p']=;mp['q']=;mp['r']=;
mp['s']=;mp['t']=;mp['u']=;mp['v']=;mp['w']=;mp['x']=;mp['y']=;mp['z']=;mp['.']=;
int n,len,i,j,k;
while(~scanf("%d",&k)&&k)
{
scanf("%s",str);
len=strlen(str);
for(i=;i<len;i++)
{
ccode[i]=mp[str[i]];
pcode[i*k%len]=(ccode[i]+i)%;
}
for(i=;i<len;i++) printf("%c",dc[pcode[i]]);
printf("\n");
}
return ;
}
hdu-1129(模拟题)的更多相关文章
- hdu 4801模拟题
/* 模拟: 注意:实质上一次魔方的一半要变化 用c++超内存 用g++过了 */ #include<stdio.h> #include<string.h> #include& ...
- HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011亚洲北京赛区网络赛)
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 ...
- HDU 4452 Running Rabbits (模拟题)
题意: 有两只兔子,一只在左上角,一只在右上角,两只兔子有自己的移动速度(每小时),和初始移动方向. 现在有3种可能让他们转向:撞墙:移动过程中撞墙,掉头走未完成的路. 相碰: 两只兔子在K点整(即处 ...
- hdu 5641 King's Phone(暴力模拟题)
Problem Description In a military parade, the King sees lots of new things, including an Andriod Pho ...
- HDU 1262 寻找素数对 模拟题
题目描述:输入一个偶数,判断这个偶数可以由哪两个差值最小的素数相加,输出这两个素数. 题目分析:模拟题,注意的是为了提高效率,在逐个进行判断时,只要从2判断到n/2就可以了,并且最好用打表法判断素数. ...
- HDU 2093 考试排名 模拟题
解题报告: 题目描述:写一个程序给一个编程考试C++实时提交系统排名,给你的数据是题目的总数,每次错误提交罚的时间分,每位用户的姓名,然后是输入用户每题的完成情况,有一下几种情况,第一,输入只有一个正 ...
- hdu 4706:Children's Day(模拟题,模拟输出大写字母 N)
Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- HDU 2414 Chessboard Dance(模拟题,仅此纪念我的堕落)
题目 模拟题也各种wa,我最近真的堕落了,,,,,智商越来越为负数了!!!!!!!! #include<stdio.h> #include<string.h> #include ...
- poj 1008:Maya Calendar(模拟题,玛雅日历转换)
Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 64795 Accepted: 19978 D ...
- poj 1888 Crossword Answers 模拟题
Crossword Answers Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 869 Accepted: 405 D ...
随机推荐
- 迭代器iter()
from collections import Iterable print(isinstance({},iterable)) # 判断是否可迭代 from collections import It ...
- 常用html设置:
省略 居中 1. 省略 ellipsis: text-overflow:ellipsis: 要求容器必须是固定的,要不然无法做省略. table的省略 table{ table_layout:fixe ...
- python 文件移动
python实现文件移动: import shutil shutil.move("original_path", "new_folder") # move fi ...
- Java HashMap两种遍历方式
第一种: Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Ma ...
- tair介绍以及配置
简介 tair 是淘宝自己开发的一个分布式 key/value 存储引擎. tair 分为持久化和非持久化两种使用方式. 非持久化的 tair 可以看成是一个分布式缓存. 持久化的 tair 将数据存 ...
- Python在pycharm中编程时应该注意的问题汇总
1.缩进问题 在 pycharm 中点击 enter 自动进行了换行缩进,此时应该注意:比如 if else 语句,后面跟着打印输出 print 的时候,一定注意是要if语句下的输出还是else ...
- 关于关闭TAB,IFRAME占用的内存不能释放问题
资料来源:http://jxd-zxf.iteye.com/blog/1440611 使用TAB时注意,如果TAB是引用IFRAME,关闭TAB时IFRAME不会被销毁从而导致内存不能释放,大量使用T ...
- jQuery height()、innerHeight()、outerHeight()函数的区别详解
参考来源:http://www.jb51.net/article/84897.htm 代码示例(可复制到编辑器直接打开): <!DOCTYPE html> <html lang=&q ...
- Ansiable Manage MySQL global variables
mysql_variables - Manage MySQL global variables New in version 1.3. Synopsis Requirements (on host t ...
- 新手C#SQLServer在程序里实现语句的学习2018.08.12
从C#中连接到SQL Server数据库,再通过C#编程实现SQL数据库的增删改查. ado.net提供了丰富的数据库操作,这些操作可以分为三个步骤: 第一,使用SqlConnection对象连接数据 ...