This commit is contained in:
Lynn Ochs 2020-12-04 12:20:53 +01:00
parent c41a24d512
commit 3e169f71e3

View File

@ -1,2 +1,2 @@
u=lambda x:6<sum(map(lambda y:5<len(y)and{'by':lambda x:1920<=int(x)<=2002,'iy':lambda x:2010<=int(x)<=2020,'ey':lambda x:2020<=int(x)<=2030,'hg':lambda x:(x[-1]=='m'and 150<=int(x[:-2])<=193)or(x[-1]=='n'and 59<=int(x[:-2])<=76),'hc':lambda x:7==len(x)and'#'==x[0]and int(x[1:],16)>=0,'ec':lambda x:x in'ambblubrngrygrnhzloth','pi':lambda x:len(x)==9,'ci':lambda x:0}[y[:2]](y[4:]),x)) u=lambda x:6<sum(map(lambda y:5<len(y)and{'by':lambda x:1919<int(x)<2003,'iy':lambda x:2009<int(x)<2021,'ey':lambda x:2019<int(x)<2031,'hg':lambda x:(x[-1]=='m'and 149<int(x[:-2])<194)or(x[-1]=='n'and 58<int(x[:-2])<77),'hc':lambda x:7==len(x)and'#'==x[0]and int(x[1:],16)>0,'ec':lambda x:x in'ambblubrngrygrnhzloth','pi':lambda x:len(x)==9,'ci':lambda x:0}[y[:2]](y[4:]),x))
print(sum(map(lambda x:u(x.split()),open("/dev/stdin").read().split("\n\n")))) print(sum(map(lambda x:u(x.split()),open("/dev/stdin").read().split("\n\n"))))