蓝桥杯,都知道吧
Python解决程序
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)