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 ...
随机推荐
- Ubuntu14.04下安装redis
1.首先在官网上下载redis压缩包 redis-3.2.0.tar.gz 2.解压到到当前文件夹(这里可以解压到随意位置) tar zvxf redis-3.2.0.tar.gz 3.切换到redi ...
- thinkPHP框架学习笔记
class ZhuantiAction extends Action { public function index() { $name = trim($this->_get('name')); ...
- NYOJ-791 Color the fence (贪心)
Color the fence 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 Tom has fallen in love with Mary. Now Tom w ...
- log4j2配置MDC分线程写日志
1.MDC是一个高级一些的工具,可以配置分用户(userid)写日志,也可以分线程 2.方法和道理都是相似的,在写入日志之前配置线程名或者用户id 3.如果将线程名配置为目录,可以将不同线程的日志输送 ...
- treecnt
treecnt ﹡ LH (命题人) 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 给定一棵n个节点的树,从1到n标号.选择k个点,你需要选择一些边使得这k个点通过选择 ...
- php 过滤emoji表情
function yz_expression() { foreach ($_POST as $key => &$value) { $value = preg_replace_callba ...
- ios电话监听状态
#import "ViewController.h" #import <CoreTelephony/CTCallCenter.h> #import <CoreTe ...
- 键盘虚拟键值编码表 使用keybd_Event
键盘虚拟键值编码表 使用keybd_Event 模拟键盘输入首先要用到一个API函数:keybd_event. 我们是菜鸟,所以不必具体去理解它的详细用法,只要按以下方法使用即可了!呵呵! 模拟按键有 ...
- iOS中date和string的相互转换
必须知道的内容 G: 公元时代,例如AD公元 yy: 年的后2位 yyyy: 完整年 MM: 月,显示为1-12 MMM: 月,显示为英文月份简写,如 Jan ...
- Ubuntu上安装mono
How do I use badgerports? badgerports is an Ubuntu repository. In order to use it, you must add it t ...