HDU 5347 MZL's chemistry

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

2015 Multi-University Training Contest 5

点击打开链接

#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

时间: 2024-10-12 14:47:46

HDU 5347 MZL's chemistry的相关文章

HDU 5347(MZL&amp;#39;s chemistry-打表)

MZL's chemistry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 629    Accepted Submission(s): 449 Problem Description MZL define as the first ionization energy of the chemical element Now he g

HDU 5347(2015多校5)-MZL&#39;s chemistry(打表)

题目地址HDU 5347 无脑流神题,自行脑补,百度大法好. #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <algorithm> #include <set> #include <queue> #

hdu 5348 MZL&amp;#39;s endless loop

给一个无向图(事实上是有向的.可是没有指定边的方向),你须要指定边的方向,使得每一个点入度和出度相差不超过1. 事实上就是找很多条路径.合起来能走完这个图..先统计各个顶点的度.度为奇数必是起点或终点,否则是中间点或者同为起点和终点. 邻接表建图(建双向),先从每一个奇数度顶点出发找路径,再从偶数度顶点出发找路径.经过的边要删去不然超时. #include <iostream> #include <cstring> #include <cstdio> #include

hdu 5344 MZL&#39;s xor

MZL's xor Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 911    Accepted Submission(s): 589 Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to k

HDU 5343 MZL&#39;s Circle Zhou

MZL's Circle Zhou Time Limit: 1000ms Memory Limit: 131072KB This problem will be judged on HDU. Original ID: 534364-bit integer IO format: %I64d      Java class name: Main MZL's Circle Zhou is good at solving some counting problems. One day, he comes

hdu 5349 MZL&#39;s simple problem

Problem Description A simple problem Problem Description You have a multiple set,and now there are three kinds of operations: 1 x : add number x to set 2 : delete the minimum number (if the set is empty now,then ignore it) 3 : query the maximum numbe

【multiset】hdu 5349 MZL&#39;s simple problem

[multiset]hdu 5349 MZL's simple problem 题目链接:hdu 5349 MZL's simple problem 题目大意 n次操作,插入元素.删除最小元素.查询最大元素并输出. C++STL的multiset的使用 set--多元集合(元素不可重复),multiset--可重复元素的多元集合 多元集合(MultiSets)和集合(Sets)相像,只不过支持重复对象.(具体用法请参照set容器) set和multiset内部是以平衡二叉树实现的: 从内部数据结

hdu 5343 MZL&#39;s Circle Zhou SAM

MZL's Circle Zhou 题意:给定两个长度不超过a,b(1 <= |a|,|b| <= 90000),x为a的连续子串,b为y的连续子串(x和y均可以是空串):问x+y形成的不同串的个数? 误区:开始一门心思想着求出总的可形成的字符串个数,再减去a,b中相同的子串重叠的部分:想通过连续插入a+b得到的SAM并不能获得信息:因为x,y是任意的子串,连续插入导致一定是a的后缀和b的前缀 正解:直接在计算有不同子串时,就不去计算重复的 <=>对于一个可能出现x后缀和y前缀相同

hdu 5344 MZL&#39;s xor(数学之异或)

Problem Description MZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n) The xor of an array B is defined as B1 xor B2...xor Bn Input Multiple test cases, the first line contains an inte