首页 > 其他 > 详细

HDU 5347

时间:2015-08-04 21:02:13      阅读:135      评论:0      收藏:0      [点我收藏+]

MZL‘s chemistry

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


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 x≠y
 

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


比较第一电离能的大小,B,Be,O,N,P,S特判一下就好。
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <map>
using namespace std;
int main()
{
    int a, b;
    while (scanf("%d%d", &a, &b) != EOF)
    {

        if ((a == 4 && b == 5) || (a == 5 && b == 4))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if ((a == 7 && b == 8) || (a == 8 && b == 7))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if ((a == 15 && b == 16) || (a == 16 && b == 15))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if ((a == 1 && b == 3) || (a == 3 && b == 1))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if ((a == 12 && b == 13) || (a == 13 && b == 12))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if ((a == 1 && b == 3) || (a == 3 && b == 1))
        {
            if (a>b)
            {
                cout << "SECOND BIGGER" << endl;
            }
            else
                cout << "FIRST BIGGER" << endl;
            continue;
        }
        if (a - b>=8 || b - a>=8)
        {
            if (a<b)
                cout << "FIRST BIGGER" << endl;
            else
                cout << "SECOND BIGGER" << endl;
        }
        else
        {
            if (a > b)
                cout << "FIRST BIGGER" << endl;
            else
                cout << "SECOND BIGGER" << endl;
        }
    }
    return 0;
}

 
 

版权声明:本文为博主原创文章,未经博主允许不得转载。

HDU 5347

原文:http://blog.csdn.net/sky_miange/article/details/47281763

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!