TSOC '15 Contest 1 #1 - Molecular or Non-Molecular?

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

BMP and MSA are on a mission to find the secret formula for one of the most delicious treats in the world. Cheesecake. In order to obtain this secret formula, BMP and MSA must first travel to France and meet with one of the world's most famous chefs, Jung Ho, and collect some essential information about cheesecake.

When they arrive in France, they realize that Jung Ho is not there. Thankfully, all of his famous recipes are nicely laid out on tables. BMP remembers that all the ingredients to the cheesecake recipe are molecular compounds, meaning they're only made of non-metals. BMP is presented with N compounds. For each compound, help BMP figure out whether it is a molecular compound or not. To make things easier, each element is separated with a space. You should assume that a compound is considered molecular if all of its component elements are non-metals.

BMP knows that the non-metal elements are Cl, Br, Xe, Kr, Si, As, Rn, Ne, He, H, C, N, O, F, P, S, and I.

Input Specification

The first line contains a single integer N (1 \le N \le 250).

The next N lines contain space separated elements — the formula that you will need to check. Each line of input contains under 100 space separated elements.

Output Specification

Identify whether the formula forms a molecular or non-molecular compound. If it forms a molecular compound, output Molecular!. If not, output Not molecular!. Use proper punctuation and capitalization or your solution will be rejected.

Sample Input

3
Na Cl
H H O
C H H H H H O O

Sample Output

Not molecular!
Molecular!
Molecular!

Comments


  • 1
    Viv_CCGS  commented on Sept. 28, 2022, 12:55 p.m. edit 2

    The most annoying part of the problem is trying to copy-paste the list of non-metals before realising this is impossible. Google is not helpful. Here is a list of them for you to copy-paste:

    Cl Br Xe Kr Si As Rn Ne He H C N O F P S I