ccf201809-1买菜

ccf201809-1买菜

n = int(input())
list = list(map(int,input().split()))
len = len(list)
list2 = [0 for i in range(len)]
for i in range(len):
    if(i != 0 and i != n-1):
        list2[i] = (list[i-1] + list[i] + list[i+1])//3
    elif(i == 0):
        list2[0] = (list[0] + list[1])//2
    else :
        list2[n-1] = (list[n-2] +list[n-1])//2
for i in range(len-1):
    print(list2[i],end=' ')
print(list2[len-1])

 

上一篇:力扣1669 合并链表问题


下一篇:在pytorch环境下使用jupyter的步骤