注意
- 考虑排除不合理年龄后,
人数为0
的情况
代码如下
def popQuery():
count = int(raw_input())
info = []
for i in range(count):
personInfo = raw_input().split(' ')
personInfo[1] = map(int, personInfo[1].split('/'))
if personInfo[1] <= [2014, 9, 6] and [1814, 9, 6] <= personInfo[1]:
info.append(personInfo)
if len(info) == 0:
print 0
return
sortedInfo = sorted(info, key = lambda x:x[1])
print "%d %s %s"%(len(sortedInfo), sortedInfo[0][0], sortedInfo[-1][0])
if __name__ == '__main__':
popQuery()