解题思路:
注意事项:
参考代码:
n = eval(input()) l = list(map(int, input().split())) s = 0 while True: for i in range(n): if i == 0: a = l[i] if i == n-1: l[i] = l[i]/2 + a/2 else: l[i] = l[i]/2 + l[i+1]/2 for i in range(n): if l[i]%2 != 0: l[i] += 1 s += 1 b = set(l) if len(b) == 1: print(s) break
0.0分
0 人评分