最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501
当前位置: 首页 - 科技 - 知识百科 - 正文

CodeforcesRound#269(Div.2)_html/css

来源:懂视网 责编:小采 时间:2020-11-27 15:55:57
文档

CodeforcesRound#269(Div.2)_html/css

CodeforcesRound#269(Div.2)_html/css_WEB-ITnose: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
推荐度:
导读CodeforcesRound#269(Div.2)_html/css_WEB-ITnose: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

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;}

    声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文档

    CodeforcesRound#269(Div.2)_html/css

    CodeforcesRound#269(Div.2)_html/css_WEB-ITnose: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
    推荐度:
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top