(Python3)PTA乙1028人口普查(最后一个测试点超时)

n = int(input())
Max = '1814/09/06'
Min = '2014/09/06'
max_, min_, num = '2014/09/06', '1814/09/06', 0
max_name, min_name = '', ''
for i in range(n):
    name, date = input().split()
    if date >= Max and date <= Min:
        num += 1
        if date < max_:
            max_name = name
            max_ = date
        if date > min_:
            min_name = name
            min_ = date
if num == 0:
    print(0)
else:
    print(num, max_name, min_name)


上一篇:ios containerViewController


下一篇:c# – 遍历表达式树并提取参数