-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodebuddy4.cpp
More file actions
59 lines (57 loc) · 761 Bytes
/
codebuddy4.cpp
File metadata and controls
59 lines (57 loc) · 761 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
48
49
50
51
52
53
54
55
56
57
#include <bits/stdc++.h>
using namespace std;
int dp[1000001];
/*int rec(int n)
{
if(dp[n]!=-1)
return dp[n];
if(n==0)
return 0;
if(n==1)
return 0;
if(n<=8)
return 1;
vector<int>v;
v.push_back(rec(n-2));
v.push_back(rec(n-3));
v.push_back(rec(n-5));
v.push_back(rec(n-7));
dp[n]=1;
int m=0;
while(find(v.begin(),v.end(),m)!=v.end())
m++;
dp[n]=m;
return m;
}*/
int main()
{
int t;
cin>>t;
dp[0]=0;
dp[1]=0;
dp[2]=1;
dp[3]=1;
dp[4]=1;
dp[5]=1;
dp[6]=1;
dp[7]=1;
dp[8]=1;
for(int i=9;i<=1000000;i++)
{
if(!dp[i-2] || !dp[i-3] || !dp[i-5] || !dp[i-7])
dp[i]=1;
else
dp[i]=0;
}
while(t--)
{
int n;
cin>>n;
//int ans=rec(n);
if(dp[n])
cout<<"Buddy"<<endl;
else
cout<<"Chotu"<<endl;
}
return 0;
}