A. Eleven

time limit per test1 second

memory limit per test256 megabytes

Problem Description

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.

Input

The first and only line of input contains an integer n (1 ≤ n ≤ 1000).

Output

Print Eleven’s new name on the first and only line of output.

Examples

input

8

output

OOOoOooO

input

15

output

OOOoOooOooooOoo


解题心得:

  1. 就是考的一个斐波那契的问题,很简单。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5+100;
int num[maxn];
bool vis[maxn];
int main()
{
memset(num,0,sizeof(num));
memset(vis,0,sizeof(vis));
num[0] = 1,num[1] = 1;
int n;
scanf("%d",&n);
for(int i=2;;i++)
{
num[i] = num[i-1] + num[i-2];
vis[num[i]] = true;
if(num[i] > 3000)
break;
}
vis[1] = true;
for(int i=1;i<=n;i++)
if(vis[i])
printf("O");
else
printf("o");
return 0;
}

Codeforces Round #459 (Div. 2)-A. Eleven的更多相关文章

  1. 【Codeforces Round #459 (Div. 2) A】Eleven

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 这个数列增长很快的. 直接暴力模拟看看是不是它的一项就好了 [代码] #include <bits/stdc++.h> ...

  2. Codeforces Round #459 (Div. 2)

    A. Eleven time limit per test 1 second memory limit per test 256 megabytes input standard input outp ...

  3. Codeforces Round #459 (Div. 2) D. MADMAX DFS+博弈

    D. MADMAX time limit per test 1 second memory limit per test 256 megabytes input standard input outp ...

  4. Codeforces Round #459 (Div. 2):D. MADMAX(记忆化搜索+博弈论)

    D. MADMAX time limit per test1 second memory limit per test256 megabytes Problem Description As we a ...

  5. Codeforces Round #459 (Div. 2):B. Radio Station

    B. Radio Station time limit per test2 seconds memory limit per test256 megabytes Problem Dsecription ...

  6. Codeforces Round #459 Div. 1

    C:显然可以设f[i][S]为当前考虑到第i位,[i,i+k)的状态为S的最小能量消耗,这样直接dp是O(nC(k,x))的.考虑矩阵快速幂,构造min+转移矩阵即可,每次转移到下一个特殊点然后暴力处 ...

  7. Codeforces Round #459 (Div. 2):D. MADMAX(记忆化搜索+博弈论)

    题意 在一个有向无环图上,两个人分别从一个点出发,两人轮流从当前点沿着某条边移动,要求经过的边权不小于上一轮对方经过的边权(ASCII码),如果一方不能移动,则判负.两人都采取最优策略,求两人分别从每 ...

  8. Codeforces Round #459 (Div. 2)The Monster[匹配问题]

    题意 给一个序列,包含(,),?,?可以被当做(或者),问你这个序列有多少合法的子序列. 分析 n^2枚举每一个子序列,暂时将每个?都当做右括号,在枚举右端点的时候同时记录两个信息:当前左括号多余多少 ...

  9. Codeforces Round #459 (Div. 2)C. The Monster

    C. The Monster time limit per test 1 second memory limit per test 256 megabytes input standard input ...

随机推荐

  1. android 开发-Toast控件的实现

    Toast吐司: Toast内容简单,不做过多介绍,Toast支持自带简单吐司,自定义吐司.内容简单可见代码,详见API.A toast provides simple feedback about ...

  2. oracle中scott用户下四个基本表SQL语句练习

    --选择部门中30的雇员SELECT * from emp where DEPTNO=30;--列出所有办事员的姓名.部门.编号--采用内连接方式,也就是等值链接,也是最常用的链接SELECT ena ...

  3. strlen()与mb_strlen()的作用分别是什么

    strlen和mb_strlen都是用于截取字符串的,其中strlen只针对单字节编码字符 如果是多字节编码字符 如gbk和utf8 使用strlen会出现乱码 此时可以使用mb_strlen(),专 ...

  4. mockJs语法糖用例

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  5. FusionCharts使用JavaScript渲染图表(不用Flash)

    FusionCharts可以让用户只使用JavaScript建立图表(而不是使用Flash),只需要添加另一行代码,如下所示: FusionCharts.setCurrentRenderer('jav ...

  6. WPF样式学习三

    SnapsToDevicePixels 获取或设置在呈现过程,该值来确定呈现此元素是否应使用特定于设备的像素设置. 这是一个依赖项属性. true ,如果元素应以符合呈现到设备像素;否则, false ...

  7. python基础-数据运算

             *按位取反运算规则(按位取反再加1)   详解http://blog.csdn.net/wenxinwukui234/article/details/42119265  详细内容ht ...

  8. quartz调度

    http://www.cnblogs.com/lzrabbit/archive/2012/04/14/2446942.html

  9. zabbix监控系统时间的问题

    分类: 监控 2013-03-19 21:40:11   发现zabbix监控系统时间的一个问题!zabbix监控系统时间用的key是system.localtime,返回当前的系统时间,而配置tig ...

  10. SummerVocation_Learning--java的基本概念

    基本数据类型:四类八种. 四类:整数型(默认int),浮点型(默认double),逻辑型(布尔型),文本型(字符型). 八种:int, byte, short, long; double, float ...