博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Round #269 (Div. 2)
阅读量:4954 次
发布时间:2019-06-12

本文共 2339 字,大约阅读时间需要 7 分钟。

Two polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six sticks to play with and assess the animals' creativity. Menshykov, Uslada and Horace decided to make either an elephant or a bear from those sticks. They can make an animal from sticks in the following way:

  • Four sticks represent the animal's legs, these sticks should have the same length.
  • Two remaining sticks represent the animal's head and body. The bear's head stick must be shorter than the body stick. The elephant, however, has a long trunk, so his head stick must be as long as the body stick. Note that there are no limits on the relations between the leg sticks and the head and body sticks.

Your task is to find out which animal can be made from the given stick set. The zoo keeper wants the sticks back after the game, so they must never be broken, even bears understand it.

Input

The single line contains six space-separated integers li (1 ≤ li ≤ 9) — the lengths of the six sticks. It is guaranteed that the input is such that you cannot make both animals from the sticks.

Output

If you can make a bear from the given set, print string "Bear" (without the quotes). If you can make an elephant, print string "Elephant" (wıthout the quotes). If you can make neither a bear nor an elephant, print string "Alien" (without the quotes).

Sample test(s)
input
4 2 5 4 4 4
output
Bear
input
4 4 5 4 4 5
output
Elephant
input
1 2 3 4 5 6
output
Alien
Note

If you're out of creative ideas, see instructions below which show how to make a bear and an elephant in the first two samples. The stick of length 2 is in red, the sticks of length 4 are in green, the sticks of length 5 are in blue.

题意:模拟水题

#include 
#include
#include
#include
#include
using namespace std;int main() { map
mp; mp.clear(); int f[6]; for (int i = 0; i < 6; i++) { scanf("%d", &f[i]); mp[f[i]]++; } int flag = 0; for (int i = 0; i < 6; i++) if (mp[f[i]] >= 4) { mp[f[i]] -= 4; flag = 1; break; } if (!flag) { printf("Alien\n"); return 0; } flag = 0; for (int i = 0; i < 6; i++) if (mp[f[i]] == 2) flag = 1; if (flag) printf("Elephant\n"); else printf("Bear\n"); return 0;}

版权声明:本文博客原创文章,博客,未经同意,不得转载。

转载于:https://www.cnblogs.com/hrhguanli/p/4618197.html

你可能感兴趣的文章
51nod1256乘法逆元
查看>>
工作总结07
查看>>
C/C++宏定义交换两个值
查看>>
了解jmeter
查看>>
借用一下放下歌
查看>>
将字母拆分
查看>>
未能在sysindexes中找到数据库ID11中对象ID1的索引ID1对应的行,请对sysindexes运行...
查看>>
VMware Integrated OpenStack (VIO)简介
查看>>
params简介
查看>>
实战 ASP.NET Web API
查看>>
数据库优化,性能分析
查看>>
保留小数点二位
查看>>
visio画图ER图表和字段注释
查看>>
数制转换问题:确定进制
查看>>
让简单的每天十条,亮点越来越多
查看>>
[批处理]守护NodeJS进程
查看>>
POJ2157 Check the difficulty of problems 概率DP
查看>>
欺骗眼球的滚动条 (javascript)
查看>>
PHP数组练习
查看>>
迷宫生成算法
查看>>