Eleven
1 second
256 megabytes
standard input
standard output
Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. Eleven wants her name to have exactly n characters.
Her friend suggested that her name should only consist of uppercase and lowercase letters 'O'. More precisely, they suggested that the i-th letter of her name should be 'O' (uppercase) if i is a member of Fibonacci sequence, and 'o' (lowercase) otherwise. The letters in the name are numbered from 1 to n. Fibonacci sequence is the sequence f where
- f1 = 1,
- f2 = 1,
- fn = fn - 2 + fn - 1 (n > 2).
As her friends are too young to know what Fibonacci sequence is, they asked you to help Eleven determine her new name.
The first and only line of input contains an integer n (1 ≤ n ≤ 1000).
Print Eleven's new name on the first and only line of output.
8
OOOoOooO
15
OOOoOooOooooOoo
#include<bits/stdc++.h>
using namespace std; int FB[]; void init()
{
int t;
for(int i = ; i < ; i++)
FB[i] = ;
FB[] = FB[] = ;
for(int i = ; i < ;i++)
{ FB[i] = FB[i-] + FB[i-];
}
} int main()
{
init();
int n; while(~scanf("%d",&n))
{
int temp = ;
for(int i = ; i <= n; i++)
{
if(i == FB[temp])
{
printf("O");
temp++;
}
else
{
printf("o");
}
}
printf("\n");
}
return ;
}
Eleven的更多相关文章
- Eleven puzzle_hdu_3095(双向广搜).java
Eleven puzzle Time Limit: 20000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- Codeforces Round #459 (Div. 2)-A. Eleven
A. Eleven time limit per test1 second memory limit per test256 megabytes Problem Description Eleven ...
- B - Eleven
Problem description Eleven wants to choose a new name for herself. As a bunch of geeks, her friends ...
- python爬虫-携程-eleven参数
携程-eleven分析 一.eleven的位置 通过对旁边栈的分析,它是在另一个js文件中调用的.那个js文件是一个自调用的函数,所以我们可以直接copy下来,用浏览器执行看看 执行运行是会报错的,u ...
- UVA 12672 Eleven(DP)
12672 - Eleven Time limit: 5.000 seconds In this problem, we refer to the digits of a positive integ ...
- TIJ——Chapter Eleven:Holding Your Objects
Java Provides a number of ways to hold objects: An array associates numerical indexes to objects. It ...
- Eleven scrum meeting 2015/11/5
今日工作情况 小组成员 今日完成的工作 明日待做任务 唐彬 选课和退课模块 测试 赖彦谕 病情较重,请假 病情较重,请假 金哉仁 设计app logo 测试 闫昊 调整课程简介的展示效果 整合各个模块 ...
- 100-days: eleven
Title: Facebook's live streaming(网络直播) is criticized(批评) after mosque(清真寺) shooting(枪击). live adj.现场 ...
- UVALive 6529 Eleven 区间dp
题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=4540">点击打开链接 题意: ...
随机推荐
- React-Native(一):React Native环境搭建
第一步:安装jdk 从java官网下载jdk8 配置环境变量: JAVA_HOME:D:\Program Files\Java\jdk1.8.0_111 Path中追加:%JAVA_HOME%\bin ...
- Java面试题—初级(3)
21.ArrayList和Vector的区别 这两个类都实现了List接口(List接口继承了Collection接口),他们都是有序集合,即存储在这两个集合中的元素的位置都是有顺序的,相当于一种动态 ...
- hue集成hive访问报database is locked
这个问题这应该是hue默认的SQLite数据库出现错误,你可以使用mysql postgresql等来替换 hue默认使用sqlite作为元数据库,不推荐在生产环境中使用.会经常出现database ...
- 学习React系列(四)——受控组件与非受控组件
受控组件:通过组件的状态与属性的改变来控制组件 不可控组件:直接通过底层的dom来控制组件(具体来说就是通过绑定再底层dom上的方法来实现的,比如说ref,onChange) 受控组件 functio ...
- python中关于文件的读取和写入
open()和close()方法:使用python的内置函数open()打开一个文件,创建一个file对象,相关的方法才可以调用它进行读写. file object = open(file_name ...
- elasticsearch logstash jdbc 配置 增量更新
环境前提: centos 6.5 x64 jdk 1.8 elasticsearch 6.1.4 logstash 6.1.4 kibana 6.1.4 mysql 5.x 保证上面软件已经安装,并且 ...
- Appium 在Win7环境下搭建
(一) Java环境准备 安装java sdk 环境变量配置:JAVA_HOME=D:\Program Files\Java\jdk1.8.0_92 PATH设置:%JAVA_HOME%\bin 验证 ...
- [SHOI2008]cactus仙人掌图
[题目描述] 如果某个无向连通图的任意一条边至多只出现在一条简单回路(simple cycle)里,我们就称这张图为仙人图(cactus).所谓简单回路就是指在图上不重复经过任何一个顶点的回路. 举例 ...
- hihocoder 1388 fft循环矩阵
#1388 : Periodic Signal 时间限制:5000ms 单点时限:5000ms 内存限制:256MB 描述 Profess X is an expert in signal proce ...
- 【BZOJ1835】【ZJOI2010】基站选址
原题传送门 Description 有N个村庄坐落在一条直线上,第i(i>1)个村庄距离第1个村庄的距离为Di.需要在这些村庄中建立不超过K个通讯基站,在第i个村庄建立基站的费用为Ci.如果在距 ...