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">点击打开链接 题意: ...
随机推荐
- Hive函数:SUM,AVG,MIN,MAX
转自:http://lxw1234.com/archives/2015/04/176.htm,Hive分析窗口函数(一) SUM,AVG,MIN,MAX 之前看到大数据田地有关于max()over(p ...
- MyBatis(三):数据库查询结果不为空,但是使用MyBatis框架查询为空问题
1.这个问题主要和返回字段是否和实体类javabean中的字段是否一致导致的问题. 解决方案: sql语句 : select account_id as "accountId" a ...
- 框架学习笔记之Mybatis(二)
一.动态sql 通过mybatis提供的标签,实现sql语句的拼接. 1.where <select id="findUserList" parameterType=&quo ...
- ASP.NET MVC应用迁移到ASP.NET Core及其异同简介
ASP.NET Core是微软新推出支持跨平台.高性能.开源的开发框架,相比起原有的ASP.NET来说,ASP.NET Core更适合开发现代应用程序,如跨平台.Dorker的支持.集成现代前端开发框 ...
- 【Markdown 语法】
Markdown 语法 摘抄自MWEB Markdown 的设计哲学 Markdown 的目標是實現「易讀易寫」. 不過最需要強調的便是它的可讀性.一份使用 Markdown 格式撰寫的文件應該可以直 ...
- 【webstorm使用手册】如何安装插件
Files->Settings, 搜索"plugin",如图,
- 获取IE下载历史的具体实现
背景: 博主去年在国内某知名互联网公司做URL安全检测时写的一份草稿. 最后却没用到项目上. 当时主要想用于URL网址安全的入库以及更新,需要建立下载文件以及URL的安全属性关联. 逻辑大致是这样的: ...
- Java必须了解的“递归”与“IO流”!!!
>>>First: 递归! 1. 定义: 在函数自身内部,调用函数本身的方式,称为递归. 2. 注意: 递归包括递进去.归出来两步. 首先,依次执行[函数调自身语句]上半部分的代码, ...
- [SDOI 2011]消耗战
Description 题库链接 给你一棵 \(n\) 个节点根节点为 \(1\) 的有根树,有边权. \(m\) 次询问,每次给出 \(k_i\) 个关键点.询问切断一些边,使这些点到根节点不连通, ...
- [JLOI 2014]松鼠的新家
Description 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有n个房间,并且有n-1根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的.天哪,他居然真的住在”树“上. 松鼠想 ...