码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 5347 MZL's chemistry

时间:2015-08-05 16:31:14      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

MZL‘s chemistry

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 345    Accepted Submission(s): 287


Problem Description
MZL define F(X) as the first ionization energy of the chemical element X

Now he get two chemical elements U,V,given as their atomic number,he wants to compare F(U) and F(V)

It is guaranteed that atomic numbers belongs to the given set:{1,2,3,4,..18,35,36,53,54,85,86}

It is guaranteed the two atomic numbers is either in the same period or in the same group

It is guaranteed that xy
 

Input
There are several test cases

For each test case,there are two numbers u,v,means the atomic numbers of the two element
 

Output
For each test case,if F(u)>F(v),print "FIRST BIGGER",else print"SECOND BIGGER"
 

Sample Input
1 2 5 3
 

Sample Output
SECOND BIGGER FIRST BIGGER
 

Source






#include <iostream>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int main()
{
    int a[25]=
    {
        2,10,9,18,7,36,8,
        1, 17, 54, 35, 6, 87,
        15,53,16,86,4,5,14,12,13,3,11
    };
    int x,y;
    while(~scanf("%d%d",&x,&y))
    {
        int xx,yy;
        for(int i=0; i<25; i++)
        {
            if(a[i]==x)
            {
                xx=i;
                break;
            }
        }

        for(int i=0; i<25; i++)
        {
            if(a[i]==y)
            {
                yy=i;
                break;
            }
        }
        if(xx<yy)
            printf("FIRST BIGGER\n");
        else printf("SECOND BIGGER\n");
    }
    return 0;
}


 

版权声明:本文为博主原创文章,如有特殊需要请与博主联系 QQ : 793977586。

HDU 5347 MZL's chemistry

标签:

原文地址:http://blog.csdn.net/yeguxin/article/details/47297491

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!