-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy path51_eleven_codeforces.cpp
More file actions
50 lines (42 loc) · 826 Bytes
/
51_eleven_codeforces.cpp
File metadata and controls
50 lines (42 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// main.cpp
// eleven
//
// Created by Prince Kumar on 21/08/19.
// Copyright © 2019 Prince Kumar. All rights reserved.
//
//. PROBLEMS --> ELEVEN from Codeforces
#include <iostream>
#include <cstring>
#define ll long long
using namespace std;
int main()
{
ll int a[20]={0}; // store fibonacci series
a[0]=a[1]=a[2]=1;
for(int i=3;i<20;i++)
{
a[i]=a[i-1]+a[i-2];
}
//cout<<a[19]<<endl;
// 1 1 2 3 5 8 ... if n==10
int n; cin>>n;
int b[n+1]; memset(b,0,sizeof(b));
// 1 represent 'O'
// 0 represent 'o'
for(int i=1;i<20;i++)
{
if(a[i]<=n)
{
b[a[i]]=1;
}
}
for(int i=1;i<=n;i++)
{
if(b[i]==1)
cout<<"O";
else
cout<<"o";
}
cout<<endl;
}