HDU 2672 god is a girl
先找规律,发现是斐波那契数列...然后..水题..
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std; int f[];
char s[];
void init()
{
f[]=,f[]=;
for(int i=;i<;i++)
f[i]=(f[i-]+f[i-])%;
} int main()
{
init();
while(gets(s))
{
int tot=;
int len=strlen(s);
for(int i=;i<len;i++)
{
if(s[i]>='A'&&s[i]<='Z')
{
printf("%c",(s[i]-'A'+f[tot])%+'A');
tot++;
}
else printf("%c",s[i]);
}
printf("\n");
}
return ;
}
HDU 2672 god is a girl的更多相关文章
- HDU 2672 god is a girl (字符串处理,找规律,简单)
题目 //1,1,2,3,5,8,13,21,34,55…… //斐波纳契数列 #include<math.h> #include<stdio.h> #include<s ...
- hdu 2669 Romantic (乘法逆元)
Romantic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 【转载】图论 500题——主要为hdu/poj/zoj
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- HDU 2669 Romantic(裸的拓展欧几里得)
Romantic Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- hdu图论题目分类
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
- HDU图论题单
=============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
随机推荐
- 对AppStore中的项目进行评分(转载)
在ios6.0前跳转到appstore评分一般是直接跳转到appstore评分NSString *evaluateString = [NSString stringWithFormat:@" ...
- ural 1203. Scientific Conference(动态规划)
1203. Scientific Conference Time limit: 1.0 second Memory limit: 64 MB Functioning of a scientific c ...
- NYOJ-448 寻找最大数(贪心)
NYOJ-448 寻找最大数 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大, 比如当n=920 ...
- C#采用OpenXml给word里面插入图片
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- CentOS安装配置Tomcat7
1.下载apache-tomcat-7.0.62.tar.gz 2.解压:tar -zxvf apache-tomcat-7.0.62.tar.gz 3.配置环境变量: 进入安装目录:(/usr/lo ...
- C++内存申请容易产生的错误
1.起因 前两天用python写了一款工具用来把excel文件转换成json文件,今天给他们用的时候发现在文本下看正常,但是在程序中使用就是会多出一些莫名其妙的字符. 2. 调查 原来主要是我写的工具 ...
- laravel性能优化
1. 配置信息缓存 使用以下 Artisan 自带命令,把 config 文件夹里所有配置信息合并到一个文件里,减少运行时文件的载入数量: php artisan config:cache 上面命令会 ...
- mongodb type it for more
当使用MongoChef Core 链接mongodb的时候 ,需要查看更多的数据时候,系统提示 type it for more 可以设置系统参数 DBQuery.shellBatchSize = ...
- python基础(三)列表、数组、字典
列表与元组 列表是最常用的数据类型之一,通过列表可以对数据实现最方便的存储.修改等操作 定义列表 1 >>> names = ['wangeq','zlx','jack','rose ...
- win8删除无线网络其中的一项配置
netsh wlan delete profile name="无线名称"