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">点击打开链接 题意: ...
随机推荐
- 翻译:JVM虚拟机规范1.7中的运行时常量池部分(二)
本篇为JVM虚拟机规范1.7中的运行时常量池部分系列的第二篇. 4.4.4. The CONSTANT_Integer_info and CONSTANT_Float_info Structures ...
- 阿里云下Linux服务器安装Mysql、mongodb
阿里云下Linux服务器安装Mysql.mongodb 一.MySQL的安装和配置 1.安装rpm包 rpm -Uvh http://dev.mysql.com/get/mysql-community ...
- 简单的Nginx自动化安装啊脚本
#!/bin/bash #description:Nginx installation script automatically #user:baomanji #date:2017-03-25 #ve ...
- SpringMVC(七):@RequestMapping下使用POJO对象绑定请求参数值
Spring MVC会按照请求参数名和POJO属性名进行自动匹配,自动为该对象填充属性值,支持级联属性. 如:address.city.dept.address.province等. 步骤一:定义Ac ...
- 广度优先(bfs)和深度优先搜索(dfs)的应用实例
广度优先搜索应用举例:计算网络跳数 图结构在解决许多网络相关的问题时直到了重要的作用. 比如,用来确定在互联网中从一个结点到另一个结点(一个网络到其他网络的网关)的最佳路径.一种建模方法是采用无向图, ...
- Linux OpenGL 实践篇-3 绘制三角形
本次实践是绘制两个三角形,重点理解顶点数组对象和OpenGL缓存的使用. 顶点数组对象 顶点数组对象负责管理一组顶点属性,顶点属性包括位置.法线.纹理坐标等. OpenGL缓存 OpenGL缓存实质上 ...
- Myeclipse修改设置Default VM Arguments
打开Windows-> Preferences 然后选择右侧菜单的Java->Installed JREs 点击右侧的jdk,然后点击"Edit"按钮 Default ...
- drupal8的安装
一.首先安装好linux系统虚拟机 1.在drupal官网上下载drupal包,https://www.drupal.org/download 我下载的是 https://ftp.drupal.org ...
- [LeetCode] Longest Continuous Increasing Subsequence 最长连续递增序列
Given an unsorted array of integers, find the length of longest continuous increasing subsequence. E ...
- git中的merge与rebase
之前一直对git的merge与rebase很困惑,而且一般也只使用merge而不是使用rebase.今天受高人指点理清了两者的区别. 首先对于两者而言,他们的结果是一样的,差异在于合并的方式(产生的结 ...