HUST Online Judge WebBoard
1541번 문제 >> 이거 맞지 않나요?
김민재 @ 2026-06-12 20:10:05
[ 삭제 ] #1
a = int(input())
b = input()
b = b.split()
c = 0
d = 0
c = []
for x in range(a - 1):
if d == 0:
f = int(b.pop(0))
e = f + int(b.pop(0))
c.append(f)
c.append(e)
d = 1
else:
e = e + int(b.pop(0))
c.append(e)
total = 0
for x in range(a):
total = total + int(c.pop(0))
print(total)