Problem p02935 (python)

Fixed submission:
N = int(input())
v = list(map(float, input().split()))

v.sort()

r = v[0]

for i in v[1::]:
    r = (r + i) / 2

print(r)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0
i = 0

def cook(N, V, alist, tmp, i):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        while i < N:
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
                alist.append(tmp)
                
                i += 2
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        i = 0
        cook(N, V, alist, tmp, i)
        
cook(N, V, alist, tmp, i)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0
i = 0

def cook(N, V, alist, tmp, i):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        while i < N:
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
                alist.append(tmp)
                
                i += 2
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp, i)
        
cook(N, V, alist, tmp, i)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N - 2, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
                alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
                alist.append(tmp)
            
    N = len(alist)
    V = alist
    alist = []
    tmp = 0
    cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
                alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp)
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N - 2, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N - 2, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V, alist)
        
cook(N, V, alist)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V, alist)
        
cook(N, V, alist)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1
    print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1
    print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        cook(N, alist)
        
cook(N, V)