TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n=input()
a=list(input())
result = 0
for num in a:
    result += 1/num
    
print(1/result)



n=input()
a=list(input())
result = 0
for num in a:
    result += 1/int(num)
    
print(1/result)




n=input()
a=str(input())
li = list(a.split(" "))
result = 0
for num in li:
    result += 1/int(num)
    
print(1/result)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
from functools import reduce


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

numerator = reduce(lambda a, b: a * b, A)
denominator = 0
for i in range(n):
    denominator += reduce(lambda a, b: a * b, A[:i] + A[i+1:])
print(1.0)


from functools import reduce


n = int(input())
A = list(map(int, input().split()))
if n == 1:
    print(A[0])
else:
    numerator = reduce(lambda a, b: a * b, A)
    denominator = 0
    for i in range(n):
        denominator += reduce(lambda a, b: a * b, A[:i] + A[i+1:])
    print(1.0 * numerator / denominator)


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = [int(e) for e in range(N)]
V = 0
for i in range(N):
    V += 1/A[i]
print(1/V)

N = int(input())
A = map(int, input().split())

sum = 0
sum += 1/A
ans = 0
ans += 1/sum
print(ans)

N = int(input())
A = [int(e) for e in input().split()]
V = 0
for i in range(N):
    V += 1/A[i]
print(1/V)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n =  int(input())
a =[int(input) for _ in range(n)]
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)
    
print(1/ sum(rev_a))


n =  int(input())
a =[int(input) for _ in range(n)]
b = 0
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)

for k in rev_a:
    b += k

print(1/b)
  
  



n =  int(input())
a =list(map(int,input().split()))
rev_a=[]
b=0
       

for i in a:
    j = 1 / i
    rev_a.append(j)
b=0
for k in rev_a:
    b += k

print(1/b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = input().rstrip().split(' ')
sum = 0
for a in A:
    sum += 1/a
print(1/sum)

N = int(input())
A = list(map(int,input().rstrip().split(' ')))
sum = 0
for a in A:
    sum += 1/a
print(1/sum)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

tmp = 1
for a in A:
    tmp *= a

ans = 0
for a in A:
    ans += tmp//a

print(ans)

N = int(input())
A = list(map(int, input().split()))

tmp = 1
for a in A:
    tmp *= a

ans = 0
for a in A:
    ans += tmp//a

print(tmp/ans)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = float(input())
A = list(map(float, input().split()))
a = sum(list(map(lambda x : 1 / x, A)))
aa = list(map(lambda x : 1 / x, A))
print(aa)
print(1/a)

N = float(input())
A = list(map(float, input().split()))
a = sum(list(map(lambda x : 1 / x, A)))
print(1/a)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())

sum_a_rev = 0

for i in range(n):
    val = int(input())
    sum_a_rev = sum_a_rev + 1/val

res = 1/sum_a_rev

print("{}".format(res))



n = int(input())

sum_a_rev = 0

for i in range(n):
    val = int(input())
    sum_a_rev = sum_a_rev + 1/val

res = 1/sum_a_rev

print("{}".format(res))



n = int(input())

a = input().split()

sum_a_rev = 0

for i in range(n):
    sum_a_rev = sum_a_rev + 1/int(a[i])

res = 1/sum_a_rev

print("{}".format(res))



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
a = input().split(' ')

ans = 0
for v in a:
	ans += 1 / int(v)
print(ans)


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

bunbo = 0
for value in A:
    bunbo += 1 / value
print(1/bunbo)


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
a = map(int, input().split())
import numpy as np
npa = np.array(a)
print(1/(sum(1/a))

n = int(input())
a = map(int, input().split())
import numpy as np
npa = np.array(a)
print(1/(sum(1/a)))

n = int(input())
a = list(map(int, input().split()))
import numpy as np
npa = np.array(a)
print(1/(sum(1/npa)))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = 1/A[i]
a = sum(A)
print(1/a)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

N = int(input())
A = list(map(int, input().split(" ")))
sum = 0
for i in range(N):
  sum += 1. / A[i]
print(1/sum)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())

a = map(list(int,input().split()))
ans = 0
for i in a:
    ans += i
print(1 / ans)


a = int(input())

s = input()

if(a >= 3200):
    print(s)
else:
    print('red')


n = int(input())

a = map(int,input().split())
ans = 0
for i in a:
    ans += 1/i
print(1 / ans)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
import numpy as np
n=int(input())
l= [np.array(input().split() ,dtype=np.int64)]

print(l)
l2=[]
for i in range(len(l)):
    l2.append(1/(l[i]))
    print(l2)
    sum1=np.sum(l2) 
    print(sum1) 
    ans=1/(sum1)
print(ans)

import numpy as np
n=int(input())
l= [np.array(input().split() ,dtype=np.int64)]

l2=[]
for i in range(len(l)):
    l2.append(1/(l[i]))
    sum1=np.sum(l2) 
    ans=1/(sum1)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
num = 0
for _ in range(n):
    num += 1 / int(input())
print(1 / num)

n = int(input())
nums = list(map(input().split(' '), lambda x: 1 / int(x)))
print(1 / sum(nums))

n = int(input())
nums = map(lambda x: 1 / int(x), input().split(' '))
print(1 / sum(nums))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

div = 0
for i in range(n):
    div += a / a[i]
print(1 / div)


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

div = 0
for i in range(n):
    div += 1 / a[i]
print(1 / div)


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
a =list(map(int,input()))
b = []
for i range(n):
  b[i]= 1/a[i]
  B = sum(b)
print(1/B)

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N+1):
  b.append(1.0/i)
  B = sum(b)
print(1/B)

n = int(input())
a =list(map(int,input()))
b = []
for i range(n):
  b[i]= 1/a[i]
  B = sum(b)
print("1/B")
  

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N+1):
  b.append(1.0/a[i])
  B = sum(b)
print(1.0/B)

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N+1):
  b.append(1.0/a[i])
  B = sum(b)
print(1/B)

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N+1):
  b[i]=1/a[i]
  B = sum(b)
print(1/B)

N = int(input())
a = list(map(int,input().split()))
b=[]
for i in range(N):
  b.append(1.0/a[i])
  B = sum(b)
print(1.0/B)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
a = 0
count = 0
while count < int(input())+1:
  b = int(input())
  a += 1/b
  count +=1
c = 1/a
print(c)

a = 0
for i in range(1,int(input())+1):
  a += 1/int(input())
a = 1/a
  

a = 0
for i in range(1,int(input())+1):
  b = int(input())
  a += 1/b
a = 1/a

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = map(int.input().split())
ans = 1/sum(1/x for x in A)
print(ans)

N=int(input())
A=list(map(int,input().split()))

num=0
for i in A:
   num+=1/i
    
print(1/num)    

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

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

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

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


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n=int(input())
a=[int(x) for x in input().split()]

ans=0
for i in range(a):
  ans+=1/i
print(1/ans)

n=int(input())
a=[int(x) for x in input().split()]
 
ans=0
for i in a:
  ans+=1/i
print(1/ans)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

N=int(input())
A=list(map(int,input().split()))
a=[1/float(num) for num in A]
x=sum(a)
print(1/float(x))


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n=int(input())
list_a=list(map(float,input().split()))
list_b=[1/i for i in list_a]
#print(list_b)
print(sum(list_b))

n=int(input())
list_a=list(map(float,input().split()))
list_b=[1/i for i in list_a]
#print(list_b)
print(1/sum(list_b))

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = input()
an = list(map(int, input().split()))
i=0
k=0
 
 

  
while n>i:
  k+=1/an[i]
  i+=1
  
print(1/k)

n=int(input())

i=1
k=0

while n>=i:
  f[i]=int(input())
  i+=1
  
while n>=i:
  k+=1/f[i]
  i+1
  
print(1/k)

n=int(input())
s=[int(input()) for i in range(n)]
i=0
k=0
 
 

  
while n>i:
  k+=1/s[i]
  i+1
  
print(1/k)

n=int(input())
s=[input() for i in range(n)]
i=0
k=0
 
 

  
while n>i:
  k+=1/s[i]
  i+1
  
print(1/k)

n = int(input())
an = list(map(int, input().split()))
i=0
k=0
 
 

  
while n>i:
  k+=1/an[i]
  i+=1
  
print(1/k)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N=int(input())
num2=input().split(" ")
num3=list(map(int,num2))
sum=0
fori in range(N):
  	sum+=1/num[i]
print(sum)

N=int(input())
num2=input().split(" ")
num3=list(map(int,num2))
sum=0
for i in range(N):
  	sum+=1/num3[i]
print(1/sum)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n=int(input())
lista=list(map(int,input().split()))
count=0
for a in lista:
  count+=1/a
print(i/count)

n=int(input())
l=list(map(int,input().split()))
sum=0
for ll in list:
  sum+=1/ll
print(1/sum)

n=int(input())
l=list(map(int,input().split()))
sum=0
for ll in l:
  sum+=1/ll
print(1/sum)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
import math

def main():
    n = int(input())
    a_l = list(map(int, input().split()))
    print( math.fsum(a_l)/ sum(a_l))

if __name__ == "__main__":
    main()

import math

def main():
    n = int(input())
    a_l = list(map(int, input().split()))
    frac = 0
    for a in a_l:
        frac += (1 / a)
    print(1/frac)
if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

ans = 0
for i in a:
  ans += 1/a
  
print(1/ans)

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

ans = 0
for i in a:
  ans += 1/i
  
print(1/ans)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
from fractions import Fraction

N = int(input())
A = list(map(int,input().split()))
a = []
b = []

for i in A:
  a.append(Fraction(1, i))

print(int(1 / sum(a)))


from fractions import Fraction

N = int(input())
A = list(map(int,input().split()))
a = []
b = []

for i in A:
  a.append(Fraction(1, i))

print(1 / sum(a))


from fractions import Fraction

N = int(input())
A = list(map(int,input().split()))
a = []
b = 0

for i in A:
  a.append(Fraction(1, i))

for i in a:
  b += i
print(float(1 / b))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):


using namespace std;

int main(){
  int N;
  cin >> N;
  vector<double> A(N);
  for(int i=0; i<N; i++)
    cin >> A[i];

  double sum_recip = 0.0;

  for(int i=0; i<N; i++)
    sum_recip += 1 / A[i];

  cout << 1 / sum_recip << endl;
}


N = int(input())
input_str = input()
array_strs = input_str.split(" ")
sum_recip = 0.0

for i in range(N):
    sum_recip += 1 / float(array_strs[i])

print(1 / sum_recip)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
l =[]
inv =[]
s = 0
for i in range(n):
    l.append(int(input()))

for i in l:
    i_inv = 1/i
    s += i_inv
print(1/s)

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

for i in l:
    i_inv = 1/i
    inv.append(i_inv)

for i in inv:
    s += i
print(1/s)
  

n = int(input())
l = list(map(int,input().split()))
s = 0 
for i in l:
    i_inv = 1/i
    s += i_inv
print(1/s)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
str = input()
ls = [int(u) for u in str.split()]
num = 1
denom = 0
print(ls)
for value in ls:
    denom += (1/value)
print(1/denom)

n = int(input())
str = input()
ls = [int(u) for u in str.split()]
num = 1
denom = 0
#print(ls)
for value in ls:
    denom += (1/value)
print(1/denom)

Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n=int(input())
a=list(map(float,input().split()))
s=1

for i in range(n):
  s *= a[i]

b=s/a

import numpy as np

n=int(input())
a=list(map(float,input().split()))
s=1

for i in range(n):
  s *= a[i]

b=[s/a[j] for j in range(n)]

print(s/np.sum(b))

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
import numpy as np
 
 
def main():
	n = int(input())
    nums = np.array([int(input()) for i in range(n)])
    n_total = nums.prod()
    n_denominator = sum([n_total/num for num in nums])
    ans = n_total / n_denominator
    print(ans)
  
  
if __name__ == '__main__':
    main()

import numpy as np


def main():
	n = int(input())
    nums = np.array([int(input()) for i in range(n)])
    n_total = nums.prod()
    n_denominator = sum([n_total/num for num in nums])
    ans = n_total / n_denominator
    print(ans)
  
  
if __name__ == '__main__':
    main()

 def main():
    n = int(input())
    nums = list(map(int, input().split()))
    print('{:.16g}'.format(1 / sum(1 / x for x in nums)))


if __name__ == '__main__':
    main()


import numpy as np
 
 
def main():
    n = int(input())
    nums = np.array([int(input()) for i in range(n)])
    n_total = nums.prod()
    n_denominator = sum([n_total/num for num in nums])
    ans = n_total / n_denominator
    print(ans)
  
  
if __name__ == '__main__':
    main()

def main():
    n = int(input())
    nums = list(map(int, input().split()))
    print('{:.16g}'.format(1 / sum(1 / x for x in nums)))


if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = 0
for i in range(N):
    A = A + 1 / input()
return A

print(1 / A)


N = int(input())
A = list(map(int, input().split()))
ph = []
p =  1
for i in range(N):
    p *= A[i]
for i in range(N):
    ph.append(p / A[i])
ph_sum = sum(ph)
print(p / ph_sum)


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[n])
c = sum(b)
print(1/c)

n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[i])
c = sum(b)
print(1/c)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
ans = 0

for i in A:
    a += 1/i

print(1/a)


N = int(input())
A = list(map(int,input().split()))
ans = 0

for i in A:
    ans += 1/i

print(1/ans)


Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())

num = [int(input()) for i in range(N)]

for i in num:

    sum = 1/i

answer = 1 / sum

print(int(answer))


N = int(input())

num = [int(i) for i in input().split()]
sum = 0
for i in num:

    sum += 1/i

answer = 1 / sum

print(int(answer))


N = int(input())

num = map(int,input().split())
sum = 0
for i in num:

    sum += 1/i

answer = 1 / sum

print(answer)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())
A = map(int, input().split())
print('{:.16g}'.format(1/ sum(x for x in A)))

N = int(input())
A = map(int, input().split())
print('{0:.16g}'.format(1/ sum(x for x in A)))

N = int(input())
A = map(int, input().split())
print('{:.16g}'.format(1 / sum(1 / x for x in A)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
N = int(input())

d = []
for _ in range(N):
  d.append(int(input()))

sm = 0
for i in range(N):
  sm += 1/d

print(1/sm)

_ = int(input())
print(1/sum([1/int(x) for x in input().split()]))

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
from sys import stdin
n = int(stdin.readline().rsprit())
li = list(map(int,stdin.readline().rstrip().split()))
s = 0
for i in range(n):
    s += 1/li[i]
print(1/s)

from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
s = 0
for i in range(n):
    s += 1/li[i]
print(1/s)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))
A
x = 0
for i in A:
    x += 1 / i
print(x)
y = 1/x
print(y)


# ABC138
# B Resistors in Parallel
import math
n = int(input())
A = list(map(int, input().split()))
y = 0
for i in A:
    y += 1000/i
x = 1/y*1000
print(x)


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
b = 1
sum = sum(a)
for i in range(n):
    b *= a[i]

n = int(input())
a = list(map(int,input().split()))
b = 0
for i in range(n):
    b += 1/a[i]
print(float(1/b))


Verdicts: Wrong Answer

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

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

sum = 0.0
for x in n:
  sum = sum + 1/x

print(1/sum)

n = int(input())
a = map(int, input().split())

sum = 0.0
for x in a:
  sum = sum + 1 / x

print(1/sum)

Verdicts: Runtime Error

Accepted
Problem: Given is a sequence of N integers A_1, \ldots, A_N.  Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Submission attempts (in order):
import numpy as np

def main():
    inputs = [input() for _ in range(2)]
    numbers = np.array([float(i) for i in inputs[1].split('\s')])
    numbers = np.reciprocal(numbers)
    answer = 1 / sum(numbers)
    print(answer)

if __name__ == '__main__':
    main()

import numpy as np

def main():
    inputs = [input() for _ in range(2)]
    numbers = np.array([float(i) for i in inputs[1].split(' ')])
    numbers = np.reciprocal(numbers)
    answer = 1 / sum(numbers)
    print(answer)

if __name__ == '__main__':
    main()

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):
# coding: utf-8
# Your code here!
# ABC138C
 
n = int(input())
v = list(map(int, input().split()))
print(v)
while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())

# coding: utf-8
# Your code here!
# ABC138C

n = int(input())
v = list(map(int, input().split()))
print(v)
while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())

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

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

while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())

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

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

while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
res = v[-1]
if res.is_integer():
    print(int(res))
else:
    print(res)

# coding: utf-8
# ABC138C

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)

res = v.pop()
if res.is_integer():
    res = int(res)
print(res)

Verdicts: Wrong Answer

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=list(map(int,input().split()))
sv=sorted(v)

x = (sv[0]+sv[1])/2
y = (x + sv[n-1])/2

print(y)

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

ans=v[0]

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

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

ans=v[0]

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

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()))

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


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

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(n-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


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

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


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

v.sort(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


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())
l=map(int,input().split())
sort(l)
s=l[0]
for i in range(1,n):
  s+=l[i]
  s/=2
print(s)

n=int(input())
l=[int(i) for i in input().split()]
s=0
for i in range(n-1):
	f=l[i]
    for j in range(n):
      if i!=j:
        f+=l[j]
        f=f/2
    if s<f:
      s=f
      
      

print(s)

t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in rnage(1,t):
	s+=l[i]
    s/=2
print(s)

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

t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in rnage(1,t):
  s+=l[i]
  s/=2
print(s)

t=int(input())
l=sorted(map(int, input().split()))
s=l[0]
for i in range(1,t):
  
  s+=l[i]
  s/=2
print(s)

Verdicts: Runtime Error

Runtime Error

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):
from collections import deque
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
vi = deque(v)
while len(vi) != 1:
	v0 = vi.popleft()
	v1 = vi.popleft()
	vadd = (v0+v1)/2
	vi.appendleft(vadd)
print(int(vi[0]))


from collections import deque
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
vi = deque(v)
while len(vi) != 1:
	v0 = vi.popleft()
	v1 = vi.popleft()
	vadd = (v0+v1)/2
	vi.appendleft(vadd)
print(vi[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())
A=sorted(map(int,input().split()))
ans=0
for i in range(n-1):
  ans=(ans+A[i])/2
print(ans)

n=int(input())
A=sorted(map(int,input().split()))
ans=A[0]
for i in range(1,n):
  ans=(ans+A[i])/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())
v = list(map(int,input().split()))

for i in range(N):
    if len(v) == 1:
        pass
    else:
        if min(v) in v:
            aaa =min(v)
            v.remove(min(v))
        if min(v) in v:
            bbb =min(v)
            v.remove(min(v))
            ccc =(aaa + bbb)/2
            v.append(ccc)
print(v)



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

for i in range(N):
    if len(v) == 1:
        pass
    else:
        if min(v) in v:
            aaa =min(v)
            v.remove(min(v))
        if min(v) in v:
            bbb =min(v)
            v.remove(min(v))
            ccc =(aaa + bbb)/2
            v.append(ccc)
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):
import heapq
n = int(input())
v = list(map(int,input().split()))
heapq.heapify(v)
print(v)
for _ in range(n-1):
    x = heapq.heappop(v)
    y = heapq.heappop(v)
    heapq.heappush(v,(x+y)/2)
print(v[0])

import heapq
n = int(input())
v = list(map(int,input().split()))
heapq.heapify(v)
for _ in range(n-1):
    x = heapq.heappop(v)
    y = heapq.heappop(v)
    heapq.heappush(v,(x+y)/2)
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())
d=map(int,input().split())
v=list(d)

v.sort()

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

print(s)

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

v.sort()

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

print(s)

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

v.sort()

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

print(s)

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):
A=sorted(list(map(int,input().split())))

r = (A[0]+A[1])/2
for i in range(2,len(A)):
    r=(r+A[i])/2
    
print(r)

N=int(input()) #not needed for Python, but needed for competition
A=sorted(list(map(int,input().split())))

r = (A[0]+A[1])/2
for i in range(2,len(A)):
    r=(r+A[i])/2
    
print(r)


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())
         


while len(v) > 1:
   v =　sorted(v)
   v1 = v.pop(0)
   v2 = v.pop(0)
   v.append((v1+v2)/2)
print(v[0])


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


while len(v_sort) > 1:
   v_sort =　sorted(v)
   v1 = v_sort.pop(0)
   v2 = v_sort.pop(0)
   v_sort.append((v1+v2)/2)
print(v_sort[0])

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

while len(v) > 1:
  v = sorted(v)
  v1 = v.pop(0)
  v2 = v.pop(0)
  v.append((v1+v2)/2)
print(v[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):
N = int(input())
v = list(map(int, input().split()))
v.sort()
new = v[0]
for i in range(1,N-1):
    new = (new + v[i])/2
print(new)

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

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

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

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 = sorted(list(map(int,input().split())))
c = v[0]
for i in range(1,len(v)+1):
  c = (v[i]+c)/2
print(int(c))

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


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


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 = sorted(list(map(int,input().split())))
s = [0]*n
s[0] = v[0]

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


def cumsum(n,A):
    s = [0]*(n+1)
    s[0] = A[0]
    for i in range(len(A)):
        s[i+1] = (s[i] + A[i])/2
    return s

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

for i in range(n-1):
    s = cumsum(n,v)
print(s[-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):
N = int(input())
V = [float(v) for v in input().split()]
V.sort(revese=True)
for i in range(N):
    if len(V) == 1:
        print(V[0])
        exit()
    v1 = V.pop()
    v2 = V.pop()
    V.append((v1 + v2) / 2)


def solve(string):
    n, *v = map(int, string.split())
    v = sorted(v, reverse=True)
    return str(sum(_v / 2**i for i, _v in enumerate(v[:-1], start=1)) + v[-1] / 2**(n - 1))


if __name__ == '__main__':
    print(solve(input()))


N = int(input())
V = [float(v) for v in input().split()]
V.sort(reverse=True)
for i in range(N):
    if len(V) == 1:
        print(V[0])
        exit()
    v1 = V.pop()
    v2 = V.pop()
    V.append((v1 + v2) / 2)



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):
ans = (ans + v[i])/2

n = int(input())
v = sorted(list(map(int,input().split())))
ans = (v[0] + v[1])/2

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

Verdicts: Runtime Error

Accepted