s = 'H,HE,LI,BE,B,C,N,...,MC,LV,TS,OG'.split(',') x = input() a = 1 b = 0 for i inrange(len(x)): a, b = x[i] in s and a or x[i-1:i+1] in s and b, a print(['NO','YES'][a])
G. Lingua Romana
题目描述
per nextum in unam tum XI conscribementis fac sic vestibulo perlegementum da varo. morde varo. seqis cumula varum. cis
per nextum in unam tum XI conscribementis fac sic seqis decumulamenta da varo. varum privamentum fodementum da aresulto. varum tum III elevamentum tum V multiplicamentum da bresulto. aresultum tum bresultum addementum da resulto.
si CD tum resultum non praestantiam fac sic dictum sic f(%d) = %.2f cis tum varum tum resultum egresso describe. novumversum egresso scribe. cis si CD tum resultum praestantiam fac sic dictum sic f(%d) = MAGNA NIMIS! cis tum varum egresso describe. novumversum egresso scribe. cis cis
t = [] whileTrue: try: x = int(input()); t += [x] except: break for x in t[::-1]: print('f(%d) = %s'%(x, '%.2f'%(5 * x**3 + abs(x)**.5) if x<5else'MAGNA NIMIS!'))
HEY CHRISTMAS TREE a YOU SET US UP 0 HEY CHRISTMAS TREE b YOU SET US UP 0 HEY CHRISTMAS TREE c YOU SET US UP 0 HEY CHRISTMAS TREE d YOU SET US UP 0 HEY CHRISTMAS TREE e YOU SET US UP 0 HEY CHRISTMAS TREE f YOU SET US UP 1 # a = b = c = d = e = 0, f = 1
GET YOUR ASS TO MARS a DO IT NOW I WANT TO ASK YOU A BUNCH OF QUESTIONS AND I WANT TO HAVE THEM ANSWERED IMMEDIATELY # a = read()
GET TO THE CHOPPER b HERE IS MY INVITATION a HE HAD TO SPLIT 1000 ENOUGH TALK # b = a // 1000
GET TO THE CHOPPER c HERE IS MY INVITATION b YOU'RE FIRED 1000 ENOUGH TALK # c = b * 1000
GET TO THE CHOPPER a HERE IS MY INVITATION a GET DOWN c ENOUGH TALK # a = a - c # a, b = a % 1000, a // 1000
HEY CHRISTMAS TREE isGreetThan0 YOU SET US UP @NO PROBLEMO # isGreetThan0 = True
HEY CHRISTMAS TREE n YOU SET US UP b # n = b STICK AROUND isGreetThan0 # while isGreetThan0 is True
GET TO THE CHOPPER e HERE IS MY INVITATION f YOU'RE FIRED n ENOUGH TALK # e = f * n
GET TO THE CHOPPER d HERE IS MY INVITATION e HE HAD TO SPLIT a ENOUGH TALK # e = e // a
GET TO THE CHOPPER c HERE IS MY INVITATION d YOU'RE FIRED a ENOUGH TALK # c = d * a
GET TO THE CHOPPER f HERE IS MY INVITATION e GET DOWN c ENOUGH TALK # f = e - c # f = f * n % a
GET TO THE CHOPPER n HERE IS MY INVITATION n GET DOWN 2 ENOUGH TALK # n -= 2
GET TO THE CHOPPER isGreetThan0 HERE IS MY INVITATION n LET OFF SOME STEAM BENNET 0 ENOUGH TALK # isGreetThan0 = n > 0
CHILL # end while TALK TO THE HAND f # output(f) YOU HAVE BEEN TERMINATED # end