ids = list(map(int,input().split(",")))
n = len(ids)
ids.sort()
start, maxLen = ids[0], 1
lastStart,tempLen = ids[0], 1
for i in range(1,n):
if ids[i]==ids[i-1]+1:
tempLen += 1
if tempLen>maxLen:
start,maxLen = lastStart,tempLen
else:
lastStart,tempLen = i,1
print(f"{start},{maxLen}")
4、连续空闲内存合并管理
最新推荐文章于 2024-11-12 23:15:59 发布