CodeForces 471A
来源:互联网 发布:方舟画质优化 编辑:程序博客网 时间:2024/05/17 23:06
Description
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 b
#include<stdio.h>#include<string.h>int main(){ int a[11],i,flag1=0,flag2=0,flag3=0,k; memset(a,0,sizeof(a)); for(i=0;i<6;i++) { scanf("%d",&k); a[k]++; } for(i=1;i<=9;i++) { if(a[i]==2) { flag1++; } else if(a[i]>3 &&a[i]<6) { flag2++; } else if(a[i]==6) { flag3++; } } if(flag3==1 ||(flag1==1 &&flag2==1)) { printf("Elephant\n"); } else if(flag2==1) { printf("Bear\n"); } else { printf("Alien"); } return 0;}
ear'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 Input
4 2 5 4 4 4
Bear
4 4 5 4 4 5
Elephant
1 2 3 4 5 6
Alien
Hint
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.
- CodeForces 471A
- codeforces 471A
- CodeForces-a
- Codeforces 903A A
- codeforces 471A MUH and Sticks
- CodeForces 18A A - Triangle
- CodeForces 133A A. HQ9+
- codeforces 651A A. Joysticks
- 【Codeforces 597A】A. Divisibility
- 【 Codeforces 615A】A. Bulbs
- A. Divisibility CodeForces 597A
- codeforces 417A A. Elimination
- CodeForces 534A A. Exam
- codeforces#98 a
- codeforces#99 a
- codeforces 105 div2 A
- codeforces #121 A
- Codeforces 185A Plant
- APUE学习笔记【4】
- Android开发之MVP模式(根据google的demo的修改版)
- 在Springmvc中导出报表下载Excel文件
- vc++经典技巧总结
- EasyUI之Combobox 数据加载完之后执行
- CodeForces 471A
- 一次旅途的启程
- 一步步实现带动画效果的下拉刷新
- 关于iOS提交审核的IDFA
- 扣丁学堂——显示网络图片到手机中
- 安卓DisplayMetrics获取屏幕分辨率
- HDFS HA与QJM(Quorum Journal Manager)介绍及官网内容整理
- 终于发布了一个app游戏
- 基于数码管的简单时钟系统