ここからpython
import sys import datetime y,m,d = map(int, sys.stdin.readline().split("/")) d=datetime.date(y,m,d) while True: if d.year % d.month==0 and (d.year / d.month) % d.day==0: print "%04d/%02d/%02d" % (d.year, d.month, d.day) sys.exit(0) d = d + datetime.timedelta(1)
流れでpython :)
datetime 要らんしw
import sys import datetime N=int(sys.stdin.readline()) s = sys.stdin.readline().rstrip() if N==1: print 1 sys.exit(0) #print s tt = [ x+y for x in "ABXY" for y in "ABXY" ] #print tt ans = 10000 for L in tt: for R in tt: ans = min(ans, len(s.replace(L, "L").replace(R, "R"))) print ans