#37178: python 紀錄


BensonDC (python戰士)

學校 : 不指定學校
編號 : 240921
來源 : [1.175.217.87]
最後登入時間 :
2024-03-27 12:33:26
g798. 帶動商機 (Business) -- TOI練習賽202111新手組第3題 | From: [36.238.105.93] | 發表日期 : 2023-08-23 21:21

S=[int(x) for x in input().split()]
S.pop()
N=int(input())
for i in range(N):
    temp=[0]*len(S)
    for j in range(len(S)):
        if j==0:
            if S[0]>S[1]:
                temp[1]+=int(S[0]*0.1)
        elif j==len(S)-1 :
            if S[j]>S[j-1]:
                temp[j-1]+=int(S[j]*0.1)
        else:
            if S[j]>S[j-1]:
                temp[j-1]+=int(S[j]*0.05)
            if S[j]>S[j+1]:
                temp[j+1]+=int(S[j]*0.05)
    for j in range(len(S)):
        S[j]+=temp[j]
print(*S)

 
ZeroJudge Forum