ルビー、1068バイト
require"zlib"
require"base64"
$><<eval(Zlib::Inflate.inflate(Base64.decode64"eJwlU8tu2zAQ/Bee+QW6CLYTx0FiR7CdtsmNkmhJCEUKfKQViv57Z9YnE+vd2ZnZ0d+1j2Go6oO2bipzpQ5W6SmPU6nU66S0jatzldqiGmLwVb3VJrZ87NAmoyf9Zx0sKm/alRCnqt5riw514lAvqCejtBm8TZU6Dgp984SGjcMuN3WhUhfsGkNaxqpudHG3Eqv6okdHPLVDXxwIuYmAzCalqn7RxnWkuQN2Z3yPxktH8sbjeQWg8QbV+oceY5iJE1kbDICOHpBE3JNka1zG3wHT3ZeF3hOmw7LYiGpB1XeV+sSIcY4rnwydmQn0hPmYLFduEqpOnhdWg4jcYmlclwyRL3iWdiLTc6s07PNYe0E15wjc+kNPsSOrT9Sm0HLXCZ3BrW0P0iBou9FbyIPSkkfYrs6F1vXsPY9C0aC36entNxVs4LjpZ/EKVX8/ybOnLqzHr8/TzCO0FODgvbreb4dV9bO2npx+oWSTzO6g1ER5bnlZn0eDvIgr9wbqN8kCtIEUG/qVKejFFQvRzYyx2fC6FzxLDAuej4VMg8PzqSeYOHAFrTUtEWAPK80QKQeYwf+B+4gVY5HLXGeaicFKfbS0yGaAvRL35mXsJnwNjnwF3+KHlKv6p4aV4iCIp1lQ3yAyTuLrMxY4k2lXk8kABm8KCXY06wCDR0YDmIiqFf+xfUpzgdYtw+QCc9GAdMqGnDZZtPKAzKLxHYp7JvR+nzNjjZVs7XjhKPpGWpgN8tgYGWNu3rVdcuEnt/DjykRtwG/GOdC5EYfvh5nJWjK+/WJYphts3d2YhZQRrMck0eauPXt9z95jz6/EUuEJEszvyOS9xnsIYcH5xmiLhQ9MkWkDqhcYE0YhvmU0U5ITcMWUGeMjTYgzTqAeUA3W5wFgHMPHhxU7prP4DLD3gmZnY/gGNSflxbIMzROCDnWv31JOUk7yDh3fQf37D7D/kWs="))[gets.downcase[1..5].to_sym]
STDINを介した入力。
要素名の最も短い一意の部分文字列は、2番目から6番目の文字(または短すぎる場合は名前の末尾)です。だから私は単にそれらを取得し、ハッシュでそれらを検索しています。ハッシュも圧縮しました。これにより、さらに200バイト節約できます。ハッシュ自体は次のようになります。
{ydrog:?H,elium:"He",ithiu:"Li",eryll:"Be",oron:?B,arbon:?C,itrog:?N,xygen:?O,luori:?F,eon:"Ne",
odium:"Na",agnes:"Mg",lumin:"Al",ilico:"Si",hosph:?P,ulfur:?S,hlori:"Cl",rgon:"Ar",otass:?K,
alciu:"Ca",candi:"Sc",itani:"Ti",anadi:?V,hromi:"Cr",angan:"Mn",ron:"Fe",obalt:"Co",ickel:"Ni",
opper:"Cu",inc:"Zn",alliu:"Ga",erman:"Ge",rseni:"As",eleni:"Se",romin:"Br",rypto:"Kr",ubidi:"Rb",
tront:"Sr",ttriu:?Y,ircon:"Zr",iobiu:"Nb",olybd:"Mo",echne:"Tc",uthen:"Ru",hodiu:"Rh",allad:"Pd",
ilver:"Ag",admiu:"Cd",ndium:"In",in:"Sn",ntimo:"Sb",ellur:"Te",odine:?I,enon:"Xe",esium:"Cs",
arium:"Ba",antha:"La",erium:"Ce",raseo:"Pr",eodym:"Nd",romet:"Pm",amari:"Sm",uropi:"Eu",
adoli:"Gd",erbiu:"Tb",yspro:"Dy",olmiu:"Ho",rbium:"Er",huliu:"Tm",tterb:"Yb",uteti:"Lu",
afniu:"Hf",antal:"Ta",ungst:?W,heniu:"Re",smium:"Os",ridiu:"Ir",latin:"Pt",old:"Au",ercur:"Hg",
halli:"Tl",ead:"Pb",ismut:"Bi",oloni:"Po",stati:"At",adon:"Rn",ranci:"Fr",adium:"Ra",ctini:"Ac",
horiu:"Th",rotac:"Pa",raniu:?U,eptun:"Np",luton:"Pu",meric:"Am",urium:"Cm",erkel:"Bk",alifo:"Cf",
inste:"Es",ermiu:"Fm",endel:"Md",obeli:"No",awren:"Lr",uther:"Rf",ubniu:"Db",eabor:"Sg",
ohriu:"Bh",assiu:"Hs",eitne:"Mt",armst:"Ds",oentg:"Rg",opern:"Cn",nuntr:"Uut",lerov:"Fl",
nunpe:"Uup",iverm:"Lv",nunse:"Uus",nunoc:"Uuo"}