有没有大佬看一下,80分第三点Wa,新手小白逻辑比较乱,感谢
查看原帖
有没有大佬看一下,80分第三点Wa,新手小白逻辑比较乱,感谢
1003161
LEle172楼主2023/5/7 21:58

n=int(input()) b=list(map(int,input().split())) cot=1 m=0 c=1 for i in range(1,n): if b[i]-1==b[i-1]: cot=cot+1 if cot==n: m=n else: if cot>m and cot>1: m=cot cot=1 if m>1: print(m) else: print(c)

2023/5/7 21:58
加载中...