蓝桥杯,都知道吧
[蓝桥杯 2013 省 AB] 错误票据(抱歉是图片形式)
Python解决程序
n = int(input())
ids = []
for i in range(n):
line = list(map(int, input().split()))
ids.extend(line)
ids.sort()
missing = 0
duplicate = 0
for j in range(len(ids) - 1):
if ids[j + 1] - ids[j] == 2:
missing = ids[j] + 1
elif ids[j + 1] - ids[j] == 0:
duplicate = ids[j]
print(missing, duplicate)
标签:AB,missing,int,ids,蓝桥,duplicate,input,2013
From: https://blog.csdn.net/2301_78398877/article/details/144663646