注意有效个数为0的输出 最后一个测试点超时
n=int(input()) count=0 Max_name,Min_name,Max_time,Min_time=None,None,None,None for i in range(n): name,t=input().split() y,m,d=t.split("/") time=y+m+d y,m,d=int(y),int(m),int(d) if '18140906'<=time<='20140906': count+=1 if count==1: Max_time,Min_time=time,time Max_name,Min_name=name,name else: if time>Max_time: Max_time,Min_name=time,name if time<Min_time: Min_time,Max_name=time,name if count>0: print(count,Max_name,Min_name) else: print(count)