A. Eleven

Codeforces
IDCF918A
Time1000ms
Memory256MB
Difficulty
brute forceimplementation
English · Original
Chinese · Translation
Formal · Original
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. <center>![image](https://espresso.codeforces.com/7b17e090ebd76d0a8a21e176ebd7cfb297cbc8ec.png)</center>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 * _f_1 = 1, * _f_2 = 1, * _f__n_ = _f__n_ - 2 + _f__n_ - 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. [samples]
Eleven 想为自己选择一个新名字。作为一群极客,她的朋友们提出了一种选名算法。Eleven 希望她的名字恰好包含 #cf_span[n] 个字符。 她的朋友建议,她的名字只能由大写和小写字母 '_O_' 组成。更准确地说,他们建议:如果 #cf_span[i] 属于斐波那契数列,则名字的第 #cf_span[i] 个字母应为 '_O_'(大写),否则为 '_o_'(小写)。名字中的字母编号从 #cf_span[1] 到 #cf_span[n]。斐波那契数列是序列 #cf_span[f],其中 由于她的朋友们太年轻,不知道什么是斐波那契数列,他们请你帮助 Eleven 确定她的新名字。 输入的第一行也是唯一一行包含一个整数 #cf_span[n](#cf_span[1 ≤ n ≤ 1000])。 请在输出的第一行也是唯一一行打印 Eleven 的新名字。 ## Input 输入的第一行也是唯一一行包含一个整数 #cf_span[n](#cf_span[1 ≤ n ≤ 1000])。 ## Output 请在输出的第一行也是唯一一行打印 Eleven 的新名字。 [samples]
Let $ n \in \mathbb{N} $, $ 1 \leq n \leq 1000 $. Define the Fibonacci sequence $ F = \{ f_1, f_2, f_3, \dots \} $ where: - $ f_1 = 1 $ - $ f_2 = 1 $ - $ f_k = f_{k-1} + f_{k-2} $ for $ k \geq 3 $ For each position $ i \in \{1, 2, \dots, n\} $, define the character $ c_i $ as: $$ c_i = \begin{cases} \text{`O'} & \text{if } i \in F \\ \text{`o'} & \text{otherwise} \end{cases} $$ Output the string $ c_1 c_2 \dots c_n $.
Samples
Input #1
8
Output #1
OOOoOooO
Input #2
15
Output #2
OOOoOooOooooOoo
API Response (JSON)
{
  "problem": {
    "name": "A. Eleven",
    "description": {
      "content": "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. <center>![image]",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF918A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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.\n\n<center>![image]...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "Eleven 想为自己选择一个新名字。作为一群极客,她的朋友们提出了一种选名算法。Eleven 希望她的名字恰好包含 #cf_span[n] 个字符。\n\n她的朋友建议,她的名字只能由大写和小写字母 '_O_' 组成。更准确地说,他们建议:如果 #cf_span[i] 属于斐波那契数列,则名字的第 #cf_span[i] 个字母应为 '_O_'(大写),否则为 '_o_'(小写)。名字中的字母编号从...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "Let $ n \\in \\mathbb{N} $, $ 1 \\leq n \\leq 1000 $.\n\nDefine the Fibonacci sequence $ F = \\{ f_1, f_2, f_3, \\dots \\} $ where:\n- $ f_1 = 1 $\n- $ f_2 = 1 $\n- $ f_k = f_{k-1} + f_{k-2} $ for $ k \\geq 3 $\n\nF...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments