-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_MUH_and_Sticks.cpp
100 lines (99 loc) · 2.14 KB
/
A_MUH_and_Sticks.cpp
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Jai shree ram
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
set<int> s;
map<int, int> mp;
int t = 6;
while (t--)
{
int x;
cin >> x;
s.insert(x);
mp[x]++;
}
// cout<<s.size()<<'\n';
// if (s.size() == 3)
// {
// cout << "Bear";
// }
if (s.size() > 3)
{
cout << "Alien";
return 0;
}
if (s.size() == 2 || s.size() == 1 or s.size() == 3)
{
int ff = 0, gg = 0, check = 0;
for (auto it : mp)
{
if (it.second == 1)
{
gg++;
}
else if (it.second == 5)
{
cout << "Bear";
ff++;
return 0;
}
else if (it.second == 4 and s.size() < 3)
{
cout << "Elephant";
ff++;
return 0;
}
else if (it.second == 4 and s.size() == 3)
{
cout << "Bear";
ff++;
check++;
return 0;
}
else if (it.second == 6)
{
cout << "Elephant";
ff++;
return 0;
}
else if (it.second == 3 or it.second == 2 and s.size() == 3)
{
ff++;
cout << "Alien";
return 0;
}
}
// int xx = 0;
// if (check > 0 and gg > 0)
// {
// cout << "Bear";
// ff++;
// xx++;
// return 0;
// }
// if (xx == 0)
// {
// cout << "Elephant";
// ff++;
// return 0;
// }
if (ff == 0)
{
cout << "Alien";
return 0;
}
}
else
cout << "Alien";
return 0;
}
// 2 2 3 3 4 4
// 2 2 2 3 4 4
// 2 2 2 2 3 4
// 2 2 3 3 3 4
// 2 3 3 3 3 4
// 2 4 4 3 3 3
// 2 2 3 3 3 3