蓝桥杯,都知道吧
[蓝桥杯 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] + 1elif ids[j + 1] - ids[j] == 0:duplicate = ids[j]
print(missing, duplicate)