ABC138 C - Alchemist
https://atcoder.jp/contests/abc138/tasks/abc138_c
提出
code: python
n = int(input())
v = list(map(int, input().split()))
v.sort(reverse=True)
while(len(v) != 1):
material1 = v.pop()
material2 = v.pop()
v.append((material1 + material2) / 2)
print(v0)
メモ
popを使わなかった失敗例
code: python
n = int(input())
v = list(map(int, input().split()))
v.sort()
pot = (v0 + v1) / 2
ans = 0
for i in range(2, n-1):
res = (pot + vi) / 2
ans += res
pot = res
print(ans)