2015 多校 #5 1005 MZL's chemistry

MZL‘s chemistry

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

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

水题。

给出两个元素的原子序数,要求比较哪个的第一电离能大....

化学都忘得差不多了==

不过好在限定了元素的范围,基本都是短周期的。

需要注意的是二三主族,五六主族,因为p轨道的全空和半充满会有反常情况(这个叫洪特规则?)

/*************************************************************************
    > File Name: code/multi/#5/1005.cpp
    > Author: 111qqz
    > Email: [email protected]
    > Created Time: 2015年08月04日 星期二 13时27分07秒
 ************************************************************************/

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<vector>
#include<stack>
#define y0 abc111qqz
#define y1 hust111qqz
#define yn hez111qqz
#define j1 cute111qqz
#define tm crazy111qqz
#define lr dying111qqz
using namespace std;
#define REP(i, n) for (int i=0;i<int(n);++i)
typedef long long LL;
typedef unsigned long long ULL;
const int inf = 0x7fffffff;

 bool cmp (int x,int y)
{
    int p[3],g[3];
    int a[3];
    a[1]=x;
    a[2]=y;
    for ( int i = 1;  i <= 2 ; i++)
    {
    if (a[i]>=1&&a[i]<=2)
    {
        p[i] = 1;
    }
    if (a[i]>=3&&a[i]<=10)
    {
        p[i] = 2;
    }
    if (a[i]>=11&&a[i]<=18)
    {
        p[i] = 3;
    }
    if (a[i]>=35&&a[i]<=36)
    {
        p[i]=4;
    }
    if (a[i]>=53&&a[i]<=54)
    {
        p[i] = 5;
    }
    if (a[i]>=85&&a[i]<=86)
    {
        p[i] = 6;
    }

    }
    if (p[1]==p[2])
    {
    if (x==4&&y==5)
    {
        return true;
    }
    if (x==5&&y==4)
    {
        return false;
    }
    if (x==12&&y==13)
    {
        return true;
    }
    if (x==13&&y==12)
    {
        return false;
    }
    if (x==7&&y==8)
    {
        return true;
    }
    if (x==8&&y==7)
    {
        return false;
    }
    if (x==15&&y==16)
    {
        return true;
    }
    if (x==16&&y==15)
    {
        return false;
    }
    return x>y;
    }
    else
    {
    return x<y;
    }
}

int main()
{
    int  u,v;
    while (~scanf("%d %d",&u,&v))
    {

    if (cmp(u,v))
    {
        printf("FIRST BIGGER\n");
    }
    else
    {
        printf("SECOND BIGGER\n");
    }
    }

    return 0;
}

2015 多校 #5 1005 MZL's chemistry

时间: 2024-11-05 22:43:30

2015 多校 #5 1005 MZL's chemistry的相关文章

hdu5348(2015多校5)--MZL&#39;s endless loop(搜索)

题目链接:点击打开链接 题目大意:给出n个点,m条无向边,现在要求将无向边变为有向边,要保证每个点的出度和入度的差不超过1 直接进行搜索,对每个点进行出度和入度的判断,如果出度大,就先进行反向的搜索(每搜索一条边u,v就认为这是一条v到u的有向边),反之,进行正向搜索(每搜到一条边u,v认为这是一条u到v的有向边),一直搜索到找不到边能继续为止. 注意: 1.已经使用过的边为了防止再次被遍历,可以修改head,head[u] = edge[i].next 2.注意自环,因为搜索是判断能不能继续向

hdu5351(2015多校5)--MZL&#39;s Border(打表,,找规律)

题目链接:点击打开链接 题目大意:给出b1 = 'b' , b2 = 'a' , bi = b(i-1)b(i-2),将i-1和i-2链接起来,记录一个串的s[1-i] 和s[n-i+1-n]相同的话 Border,当i为最长是为LBorder,现在给让求在bn这个串上的前m个字符组成的子串的LBorder 通过计算可以发现,b字符串的前缀都是相同的,所以只要求出m的LBorder就行,和n是无关的,打表找出规律,找出对应不同的m,LBorder的值,因为存在大数,用java写 dp[i]第i层

2015多校 #5 1002 MZL&#39;s xor

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

2015 多校 #5 1007 MZL&#39;s simple problem

MZL's simple problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2541    Accepted Submission(s): 694 Problem Description A simple problemProblem DescriptionYou have a multiple set,and now th

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 5344(2015多校5)-MZL&#39;s xor(水题)

题目地址:HDU 5344 题意:求所有(Ai+Aj)的异或值. 思路:可以发现(Ai+Aj)和(Aj+Ai)的异或值为0,所以最后只剩下(Ai+Ai). #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <algorithm>

HDU 5352 MZL&#39;s City(2015 多校 第5场,最小费用最大流)

  MZL's City Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 291    Accepted Submission(s): 94 Problem Description MZL is an active girl who has her own country. Her big country has N cities nu

2015多校.MZL&#39;s endless loop(欧拉回路的机智应用 || 构造)

MZL's endless loop Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 898    Accepted Submission(s): 178Special Judge Problem Description As we all kown, MZL hates the endless loop deeply, and he

HDU 5349(2015多校5)-MZL&#39;s simple problem(优先队列)

题目地址:HDU 5349 很水的优先队列就能搞好,只不过注意如果2操作结束后的队列为空,那么Max的值为-inf. #include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <algorithm> #include <set&