TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
def qsort(seq, left, right):
    
    if left == right: return seq
    elif left+1 == right:
        if seq[left]>seq[right]:
          seq[left],seq[right] = seq[right], seq[left]
        return seq

    med = (left+right)//2
    pivot = seq[med] 
    
    cur_l = left
    cur_r = right
    
    
    while True:
        
        while seq[cur_l] <= pivot:
          if cur_l >= cur_r:
            break
          cur_l += 1
        
        
        while seq[cur_r] > pivot:
            if cur_r <= cur_l:
              break
            cur_r -= 1
        
        if (cur_r <= cur_l): 
          break
        
        
        seq [cur_l], seq[cur_r] = seq[cur_r], seq[cur_l]
        cur_l += 1
        cur_r -= 1
    print(seq)
    cut = -1
    if cur_l == cur_r:
        #print('pp')
        if seq[cur_l] < pivot:
            #print('qq')
            cut = cur_l
        else:
            #print('rr')
            cut = cur_l-1
    elif cur_l == cur_r+1:
        #print('ss')
        cut = cur_r
    print(cut)

    
    
    
    qsort(seq,left,cut)
    
    qsort(seq,cut+1,right)
    
    return 0

import sys


def qsort(seq, left, right):
    
    if left == right: return seq
    elif left+1 == right:
        if seq[left]>seq[right]:
            seq[left],seq[right] = seq[right], seq[left]
        return seq
    med = (left+right)//2
    pivot = seq[med] 
    
    cur_l = left
    cur_r = right
    
    while True:
        
        while seq[cur_l] < pivot:
            if cur_l >= cur_r: break
            cur_l += 1
        
        while seq[cur_r] > pivot:
            if cur_r <= cur_l: break
            cur_r -= 1
        
        if (cur_r <= cur_l): break
        
        
        seq [cur_l], seq[cur_r] = seq[cur_r], seq[cur_l]
        cur_l += 1
        cur_r -= 1
    #print(seq)
    cut = -1
    if cur_l == cur_r:
        #print('pp')
        if seq[cur_l] < pivot:
            #print('qq')
            cut = cur_l
        else:
            #print('rr')
            cut = cur_l-1
    elif cur_l == cur_r+1:
        #print('ss')
        cut = cur_r
    #print(cut)
    
    
    
    qsort(seq,left,cut)
    
    qsort(seq,cut+1,right)
    

N = int(input())
vec = list(map(int,input().split()))
qsort(vec,0,N-1)
ans = vec[0]
for i in range(N-1):
  ans = (ans + vec[i+1])/2
print(ans)




Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n=int(input())
a=sorted(list(map(int, input().split())))
ans=a[0]
for i in range(n):
    ans+=a[i]
    ans=ans//2
print(ans)


n=int(input())
a=list(map(int, input().split()))
a.sort()
ans=a[0]
for i in range(n):
    ans+=a[i]
    ans=ans//2
print(ans)

n=int(input())
a=list(map(int, input().split()))
a.sort()
ans=a[0]
for i in range(n):
    ans+=a[i]
    ans=ans//2
print(ans)

n=int(input())
a=list(map(int, input().split()))
a.sort()
ans=a[0]
for i in range(n):
    ans+=a[i]
    ans=ans/2
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = [int(e) for e in input().split()]

a = sorted(v, reversed = True) 
result = a[0]
for i in range(N - 1):
    result += (result + a[i]) / 2
print(result)

N = int(input())
v = [int(e) for e in input().split()]

a = sorted(v, reversed = True) 
result = a[0]
for i in range(1, N):
    result = (result + a[i]) / 2
print(result)

N = int(input())
v = [int(e) for e in input().split()]

a = sorted(v, reversed = True) 
result = a[0]
for i in range(1, N):
    result += (result + a[i]) / 2
print(result)

N = int(input())
v = [int(e) for e in input().split()]

v.sort() 
result = v[0]
for i in range(1, N):
    result = (result + v[i]) / 2
print(result)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
V = list(map(int,input().rstrip().split(' ')))
V.sort(reverse=True)

sum = 0
for i, v in enumerate(V):
    sum += v/(2**(i+1))
sum += V[-1]/(2**(N-1))
print(sum)

N = int(input())
V = list(map(int,input().rstrip().split(' ')))
V.sort(reverse=True)

sum = 0
for i, v in enumerate(V):
    sum += v/(2**(i+1)))
sum += V[-1]/(2**(N-1))
print(sum)

N = int(input())
V = list(map(int,input().rstrip().split(' ')))
V.sort(reverse=True)

sum = 0
for i, v in enumerate(V):
    sum += v/(2**(i+1))
sum += V[-1]/(2**(N))
print(sum)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))
v.sort()
ans=0
for i in range(n):
  if i==0:
    ans+=v[n-1]/2
  elif i==n-1:
    ans+=v[0]/(2**(n-2))
  else:
    ans+=v[n-1-i]/(2**i)
print(ans)

n=int(input())
v=list(map(int,input().split()))
v.sort()
for i in range(n-1):
  v[i+1]=(v[i]+v[i+1])/2
print(v[n-1])

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
from heapq import heapify, heappush
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    a= heappop(L)
    b= heappop(L)
    s=(a+b)/2
    heappush(L,s)
print(s)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):

#include <algorithm>

using namespace std;

#define ld long double

int main() {
    ll n;
    cin >> n;
    vector<ll> numbers(n);
    for(auto &i: numbers) cin >> i ;
    sort(numbers.begin(), numbers.end());
    ld ans = numbers[0];
    for(auto i: numbers) {
        ans = (ans + i)/2;
    }
    cout << ans << endl;
    return 0;
}

n=int(input())
l=[float(i) for i in input().split()]
l.sort()
while len(l)>1:
    # print(l)
    a,b=l[0],l[1]
    av=(a+b)/2
    del l[0]
    del l[0]
    l.append(av)
    l.sort()
print(l[0])

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
V = sorted(list(map(int,input().split())))

ans = 0

ans += (V[0]+V[1])/2**(len(V)-1)

print(ans)

for i in range(2,N):
    ans += V[i]/2**(N-i)

print(ans)

N = int(input())
V = sorted(list(map(int,input().split())))

ans = (V[0]+V[1])/2**(len(V)-1)

for i in range(2,N):
    ans += V[i]/2**(N-i)

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n=int(input())
v=list(map(int ,input().split()))
l=[]
draw_list=[]
second_draw=[]
for i in range(0,len(v)-1):
    first_combination=float((v[i]+v[i+1])/2)
    draw_list.append(first_combination)
    
for j in range(0,len(v)-1):
    second_combination=float((draw_list[j]+v[j])/2)
    second_draw.append(second_combination)
    

draw_list.extend(second_draw)
print(int(max(draw_list)))

n=int(input())
v=list(map(int ,input().split()))
l=[]
draw_list=[]
second_draw=[]
for i in range(0,len(v)-1):
    first_combination=float((v[i]+v[i+1])/2)
    draw_list.append(first_combination)
    
for j in range(0,len(v)-1):
    second_combination=float((draw_list[j]+v[j])/2)
    second_draw.append(second_combination)
    

draw_list.extend(second_draw)
print(int(max(draw_list)))

M = int(input())
A = list(map(int,input().split()))
A.sort()
count = 0
count = (A[0]+A[1])/2
for i in range(2,M):
  count = (count+A[i])/2
  
print(count)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = list(map(int,input().split()))
def func(a,b):
    return (a+b)/2
  v = sorted(v)
ave = (v[0]+v[1])/2
for i in range(2,N):
    ave = func(ave,v[i])
    
print(ave)

N = int(input())
v = list(map(int,input().split()))
def func(a,b):
    return (a+b)/2
v = sorted(v)
ave = (v[0]+v[1])/2
for i in range(2,N):
    ave = func(ave,v[i])
    
print(ave)

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = list(map(int, input().split(" ")))

v.sort()

sum = v[0]

for i in range(N-1):
  sum = (sum + v[i+1]) / 2
print(int(sum))

N = int(input())
v = list(map(int, input().split(" ")))

v.sort()

sum = v[0]

for i in range(N-1):
  sum = (sum + v[i+1]) / 2
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
vi = list(map(int,input().split()))
vi_sort = sorted(vi)

print(vi_sort)

if N == 2:
  print((vi[0]+vi[1])/2)
else:
  i = 0
  while i < (N-1):
    new_number = (vi_sort[0]+vi_sort[1])/2
    del vi_sort[0:2]
    vi_sort.append(new_number)
    vi_sort.sort()
    i += 1
    
  print(vi_sort[0])

N = int(input())
vi = list(map(int,input().split()))
vi_sort = sorted(vi)

if N == 2:
  print((vi[0]+vi[1])/2)
else:
  i = 0
  while i < (N-1):
    new_number = (vi_sort[0]+vi_sort[1])/2
    del vi_sort[0:2]
    vi_sort.append(new_number)
    vi_sort.sort()
    i += 1
    
  print(vi_sort[0])

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))

ans = v[0]
for n in range(1, n):
  ans = (ans + v[i]) / 2.0
  
print(ans)

n = int(input())
v = list(map(int, input().split()))

v.sort()
ans = v[0]

for i in range(1, n):
  ans = (ans + v[i]) / 2.0
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
 
a.sort()
for i in range(n-1):
    a[i+1] = (a[i] + a[i+1] / 2)

print(a[-1])

n = int(input())
a = list(map(int,input().split()))
 
a.sort()
for i in range(n-1):
    a[i+1] = (a[i] + a[i+1] / 2)

print(a[-1])

n = int(input())
a = list(map(int,input().split()))
 
a.sort()
for i in range(n-1):
    a[i+1] = (a[i] + a[i+1]) / 2
 
print(a[-1])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v = sorted(list(map(int, input().split())))
print(v)
for i in range(n - 1):
    v[i + 1] = (v[i] + v[i + 1]) / 2

print(v[n - 1])


n = int(input())
v = sorted(list(map(int, input().split())))

for i in range(n - 1):
    v[i + 1] = (v[i] + v[i + 1]) / 2

print(v[n - 1])


Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
# -*- coding: utf-8 -*-

N = int(input())
v = [int(a) for a in input().split()]

v.sort()

for i in range(N-1):
    tmp = (v[0]+v[1])/2
    v.pop(0)
    v.pop(0)
    v.insert(0,tmp)
    v.sort()
    print(v)

print(v[0])


# -*- coding: utf-8 -*-
 
N = int(input())
v = [int(a) for a in input().split()]
 
v.sort()
 
for i in range(N-1):
    tmp = (v[0]+v[1])/2
    v.pop(0)
    v.pop(0)
    v.insert(0,tmp)
    v.sort()
 
print(v[0])

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N+1):
    res = (res+v[i])/2
print(res)

N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N):
    res = (res+v[i])/2
print(res)

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    tn  = (v[0]+v[1])/2
    v.pop(0)
    v.pop(0)
    v.insert(0,tn)

print(v)

N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    tn  = (v[0]+v[1])/2
    v.pop(0)
    v.pop(0)
    v.insert(0,tn)

print(v[0])

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))
sort_v = sorted(v, reverse=False)
print(sort_v)
sum_tmp = 0
for i in range(2, n):
  sum_tmp += sort_v[i]*(2**(i-1))
sum_all = sort_v[0] + sort_v[1] + sum_tmp
div = 2 ** (n-1)
ans = sum_all / div
print(ans)
  
  

n = int(input())
v = list(map(int, input().split()))
sort_v = sorted(v, reverse=False)
sum_tmp = 0
for i in range(2, n):
  sum_tmp += sort_v[i]*(2**(i-1))
sum_all = sort_v[0] + sort_v[1] + sum_tmp
div = 2 ** (n-1)
ans = sum_all / div
print(ans)
  

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = list(map(int, input().split())) 
import bisect
v.sort()
for i in range(N-1):
  bisect.insort(v,(v.pop(0)+v.pop(0))/2)
print(v)


N = int(input())
v = list(map(int, input().split())) 
import bisect
v.sort()
for i in range(N-1):
  bisect.insort(v,(v.pop(0)+v.pop(0))/2)
print(*v)


Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if a = 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)



a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if a == 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)

a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if i == 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n, q = map(int, input().split())
tree = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

xs = [0] * n
for _ in range(q):
    p, x = map(int, input().split())
    xs[p-1] += x

ans = [0] * n

def dfs(u, parent=None):
    ans[u] = ans[parent] + xs[u]
    for v in tree[u]:
        if not v == parent:
            dfs(v, u)

dfs(0, 0)
print(' '.join([str(i) for i in ans]))


n=int(input())
vs=list(map(int,input().split()))
while not len(vs)==1:
    vs.sort()
    a=vs.pop(0)
    b=vs.pop(0)
    t=(a+b)/2
    vs.append(t)
print(vs[0])


Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N=int(input())
V=sorted(list(map(int,input().split())))
print(V)
while len(V)!=2:
    a=(V[0]+V[1])/2
    V.pop(0)
    V.pop(1)
    V.insert(0,a)
print((V[0]+V[1])/2)

N=int(input())
V=sorted(list(map(int,input().split())))
while len(V)!=2:
    a=(V[0]+V[1])/2
    V.pop(0)
    V.pop(0)
    V.insert(0,a)
print((V[0]+V[1])/2)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    v[i+1] = (v[i]+v[i+1]) / 2

print(v[n-1])

N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    v[i+1] = (v[i]+v[i+1]) / 2

print(v[N-1])

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N=int(input())
v = list(map(float,input().split()))
v.sort()
print(v)

ans = v[0]
for i in range(N-1):
    ans = (ans+v[i+1])/2

print(ans)


// Last Change: 08/18/2019 21:25:06.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <memory>
#include <numeric>

#include <set>
#include <stack>
#include <string>


using namespace std;
using ll = long long;

int main() {
  ll N;
  cin >> N;
  vector<double> v(N);
  for (auto &&e : v) {
    cin >> e;
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for (ll i = 1; i < N; ++i) {
    ans = (ans + v[i]) / 2;
  }
  cout << ans << endl;
}



N=int(input())
v = list(map(float,input().split(' ')))
v.sort()

ans = v[0]
for i in range(N-1):
   ans = (ans+v[i+1])/2

print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))

v.sort(reverse=True)

while len(v)!=1:
    tmp=(v.pop()+v.pop())/2
    v.append(tmp)
print(v)

n=int(input())
v=list(map(int,input().split()))

v.sort(reverse=True)

while len(v)!=1:
    tmp=(v.pop()+v.pop())/2
    v.append(tmp)
print(*v)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))

v.sort()
i=0

k=v[0]
 
 

  
while n>i:
  k+=v[i-1]
  k=k/2
  i+=1
  
print(k)

n = int(input())
v = list(map(int, input().split()))
i=0
k=v[0]
 
 

  
while n>i:
  k+=v[i-1]
  k=k/2
  i+=1
  
print(k)

n = int(input())
v = list(map(int, input().split()))
v.sort()
i=1
k=v[0]
 
 
 
  
while n>i:
  k+=v[i]
  k=k/2
  i+=1
  
print(k)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n=int(input())
l=list(map(int,inout().split()))
l.sort()
new=(l[0]+[1])/2
if n>=3:
  for i in range(2,n):
    new=(new+l[i])/2
  print(new)
else:
  print((l[0]+l[1])/2)
    

n=int(input())
l=list(map(int,input().split()))
print(max(l))

n=int(input())
l=list(map(int,input().split()))
l.sort()
new=(l[0]+l[1])/2
if n>=3:
  for i in range(2,n):
    new=(new+l[i])/2
  print(new)
else:
  print((l[0]+l[1])/2)
    

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))
v.sort(reverse=True)
ans = 0
div = 2
for i in range(n-1):
  ans += v[i]/div
  div *= 2
ans += v[n-1]/div
print(ans)

n = int(input())
v = list(map(int, input().split()))
v.sort(reverse=True)
ans = 0
div = 1
for i in range(n-1):
  div *= 2
  ans += v[i]/div
ans += v[n-1]/div
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N=int(input())
a=[x for x in map(int,input().split())]
x=0
for i in a:
    x+=1/i
print(1/x)

N=int(input())
x=[x for x in map(float,input().split())]
x.sort()
a=0
for i in range(N):
    if i==0 or i==1:
        a+=x[i]/2**(N-1)
    else:
        a+=x[i]/2**(N-i)
print(a)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
# -*- coding: utf-8 -*-

n = int(input())

a = list(map(float, input().split()))
value = a[0]
#value = a.get(0)
for i, e in enumerate(a):
	if i > 0:
		value += (value + e)/2
print(value)

# -*- coding: utf-8 -*-

n = int(input())

a = sorted(list(map(float, input().split())))
value = a[0]
#value = a.get(0)
for i, e in enumerate(a):
	if i > 0:
		value = (value + e)/2
print(value)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
l =[]
for i in range(n):
    l.append(int(input()))
l = sorted(l)
 
for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])

n = int(input())
l =[]
for i in range(n):
    l.append(int(input()))
l.sort()

for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])

n = int(input())
l =list(map(int,input().split()))
l = sorted(l)
 
for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
import random
num = int(input())
s =list(map(int,input().split()))
s =sorted(s)
a = s[0]


print(a)
for i in range(num):
  a=(a+s[i])/2
print(a)

import random
num = int(input())
s =list(map(int,input().split()))
s =sorted(s)
a = s[0]

for i in range(num):
  a=(a+s[i])/2
print(a)

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
3
500 300 200

import heapq

n = int(input())
v = list(map(int, input().split()))

heapq.heapify(v)
work = heapq.heappop(v)

for _ in range(n - 1):
    work += heapq.heappop(v)
    work /= 2

print(work)

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n = int(input())
v_list = list(map(int, input().split()))
while len(v_list) != 1:
    sort(v_list)
    a = v_list.pop()
    b = v_list.pop()
    v_list.append((a + b) / 2)
print(v_list[0])

N = int(input())
v = list(map(int, input().split()))
 
while len(v) != 1:
    v.sort(reverse = True)
    a = v.pop()
    b = v.pop()
    v.append((a+b)/2)
    
 
print(v[0])

Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
def c_alchemist():
    N = int(input())
    V = [int(i) for i in input().split()]
    v = sorted(V, reverse=True)
    while len(v) > 1:
        x = v.pop()
        y = v.pop()
        v.append((x + y) / 2)
    return sum(v)

def c_alchemist():
    from functools import reduce
    N = int(input())
    V = [int(i) for i in input().split()]
    return reduce(lambda x, y: (x + y) / 2, sorted(V))

print(c_alchemist())

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
n,q = map(int, input().split())
a = []
for i in range(n-1):
    a.append((input()))

b = []
for j in range(q):
    b.append((input()))
    
aws = []
for k in range(n):
    aws.append(0)
    
def tree(t_num,point):
    aws[t_num - 1] +=  point
    for an in a:
        if t_num == int(an.split()[0]):
            tree(int(an.split()[1]),point)
for bn in b:
    t_num = int(bn.split()[0])
    point = int(bn.split()[1])
    tree(t_num,point)
    
aws_2 = []
for h in aws:
    str_h = str(h)
    aws_2.append(str_h)
print(" ".join(aws_2))


n = int(input())
numbers = list(map(int,input().split()))

def aaa(numbers):
    if len(numbers) > 1:
        numbers.sort()
        new_number = (numbers[0] + numbers[1]) / 2
        n_0 = numbers[0]
        n_1 = numbers[1]
        numbers.remove(n_0)
        numbers.remove(n_1)
        numbers.append(new_number)
        aaa(numbers)
    else:
        return numbers[0]
      
aaa(numbers)

n = int(input())
numbers = list(map(int,input().split()))


def aaa(numbers):
    if len(numbers) > 1:
        numbers.sort()
        new_number = (numbers[0] + numbers[1]) / 2
        n_0 = numbers[0]
        n_1 = numbers[1]
        numbers.remove(n_0)
        numbers.remove(n_1)
        numbers.append(new_number)
        if len(numbers) > 1:
                return new_number
        else:
            aaa(numbers)
    else:
        return numbers[0]
      
aaa(numbers)

n = int(input())
numbers = list(map(int,input().split()))

def aaa(numbers):
    if len(numbers) > 1:
        numbers.sort()
        new_number = (numbers[0] + numbers[1]) / 2
        n_0 = numbers[0]
        n_1 = numbers[1]
        numbers.remove(n_0)
        numbers.remove(n_1)
        numbers.append(new_number)
        aaa(numbers)
    else:
        return numbers[0]
      

aaa(numbers)
aaa(numbers)

n = int(input())
numbers = list(map(int,input().split()))
 
def aaa(numbers):
    if len(numbers) > 1:
        numbers.sort()
        new_number = (numbers[0] + numbers[1]) / 2
        n_0 = numbers[0]
        n_1 = numbers[1]
        numbers.remove(n_0)
        numbers.remove(n_1)
        numbers.append(new_number)
        aaa(numbers)
    else:
        return numbers[0]
      
aaa(numbers)
print(aaa(numbers))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N = int(input())
V = map(int, input().split())
a = (V[0] + V[1]) / 2
for i in range(2, N):
  a = (a + V[i]) / 2
print(a)

N = int(input())
V = sorted(map(int, input().split()))
a = (V[0] + V[1]) / 2
for i in range(2, N):
  a = (a + V[i]) / 2
print(a)


Verdicts: Runtime Error

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
N=int(input())
List=list(map(int,input().split()))
List.sort(reverse=True)
ans=0
for i in range(N-1):
  k = List[i]/(2**(i+1))
  ans += k
l = List[N]/(2**(N-1))
ans += l
print(ans)
          
  

N=int(input())
List=list(map(int,input().split()))
List.sort(reverse=True)
ans=0
for i in range(N-2):
  k = List[i]/(2**(i+1))
  ans += k
l = List[N-1]/(2**(N-1))
ans += l
print(ans)
          
  


N = int(input())
v = list(map(int, input().split()))
v.sort()
v.reverse()
result = 0

for i, x in enumerate(v):
    if i == N - 1:
        i = N - 2
    result += x / pow(2, i + 1)

print(result)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
import itertools
n = int(input())
v = list(map(int,input().split()))
values = []
for root in itertools.permutations(v):
  pot = root[0]
  for i in range(n - 1):
    pot = (pot + root[i + 1]) // 2
    if i == n - 2:
      values.append(pot)
print(max(values))

n = int(input())
v = list(map(int,input().split()))
values = []
v = sorted(v)
pot = v[0]
for i in range(n - 1):
  pot = (pot + v[i + 1]) / 2
  if i == n - 2:
    values.append(pot)
print(max(values))

Verdicts: Wrong Answer

Accepted
Problem: You have a pot and N ingredients. Each ingredient has a real number parameter called _value_ , and the value of the i-th ingredient (1 \leq i \leq N) is v_i.  When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.  After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

Submission attempts (in order):
import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))
v_sort = np.sort(v)
temp = 0

for index in range(n-1):
  temp = int((v_sort[0]+v_sort[1])/2)
  v_sort = np.delete(v_sort,0)
  v_sort = np.delete(v_sort,0)
  v_sort = np.append(v_sort,temp)
  v_sort = np.sort(v_sort)

print(int(v_sort[0]))

import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))
v_sort = np.sort(v)
temp = 0

for index in range(n-1):
  temp = (v_sort[0]+v_sort[1])/2
  v_sort = np.delete(v_sort,0)
  v_sort = np.delete(v_sort,0)
  v_sort = np.append(v_sort,temp)
  v_sort = np.sort(v_sort)

print(int(v_sort[0]))

import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))
v_sort = np.sort(v)
temp = 0

for index in range(n-1):
  temp = (v_sort[0]+v_sort[1])/2
  v_sort = np.delete(v_sort,0)
  v_sort = np.delete(v_sort,0)
  v_sort = np.append(v_sort,temp)
  v_sort = np.sort(v_sort)

print(v_sort[0])

Verdicts: Wrong Answer

Wrong Answer

Accepted