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
2015 Multi-University Training Contest 5
比较第一电离能的大小,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; }
版权声明:本文为博主原创文章,未经博主允许不得转载。