Problem p03059 (python)

Fixed submission:
raw_input = input()
a, b, t = map(int, raw_input.split())
counter = (t+0.5)//a #クッキを焼く回数
number = b * counter #枚数
print('%d' % number)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_list = input().split()
A_list_i = [int(s, 0) for s in A_list]
max_gcd = 0
min_gcd = [10000000000, -1]
for i in range(N-1):
    for j in range(i+1, N):
        if A_list_i[i] == A_list_i[j]:
            temp = A_list_i[i]
        elif A_list_i[i] > A_list_i[j]:
            temp = A_list_i[i] % A_list_i[j]
        else:
            temp = A_list_i[j] % A_list_i[i]
        if temp > max_gcd:
            max_gcd = temp
        if temp < min_gcd[0]:
            min_gcd[0] = temp
            if A_list_i[i] > A_list_i[j]:
                min_gcd[1] = i
            else:
                min_gcd[1] = j
A_list_i[min_gcd[1]] = max_gcd
temp = 0
max_gcd = 0
for i in range(N-1):
    for j in range(i+1, N):
        if A_list_i[i] == A_list_i[j]:
            temp = A_list_i[i]
        elif A_list_i[i] > A_list_i[j]:
            temp = A_list_i[i] % A_list_i[j]
        else:
            temp = A_list_i[j] % A_list_i[i]
        if temp > max_gcd:
            max_gcd = temp            
print('%d' % max_gcd)

Buggy submission (verdict: Runtime Error):
    N = int(input())
    A_list = input().split()
    A_list_i = [int(s, 0) for s in A_list]
    max_gcd = 1
    min_gcd = [10000000000, -1]
    for i in range(N-1):
        for j in range(i+1, N):
            if A_list_i[i] == A_list_i[j]:
                temp = A_list_i[i]
            elif A_list_i[i] > A_list_i[j]:
                temp = A_list_i[i] % A_list_i[j]
            else:
                temp = A_list_i[j] % A_list_i[i]
            if temp > max_gcd:
                max_gcd = temp
            if temp < min_gcd[0]:
                min_gcd[0] = temp
                if A_list_i[i] > A_list_i[j]:
                    min_gcd[1] = i
                else:
                    min_gcd[1] = j
    A_list_i[min_gcd[1]] = max_gcd
    temp = 0
    max_gcd = 1
    for i in range(N-1):
        for j in range(i+1, N):
            if A_list_i[i] == A_list_i[j]:
                temp = A_list_i[i]
            elif A_list_i[i] > A_list_i[j]:
                temp = A_list_i[i] % A_list_i[j]
            else:
                temp = A_list_i[j] % A_list_i[i]
            if temp > max_gcd:
                max_gcd = temp            
    print('%d' % max_gcd)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_list = input().split()
A_list_i = [int(s, 0) for s in A_list]
max_gcd = 1
min_gcd = [10000000000, -1]
for i in range(N-1):
    for j in range(i+1, N):
        if A_list_i[i] == A_list_i[j]:
            temp = A_list_i[i]
        elif A_list_i[i] > A_list_i[j]:
            temp = A_list_i[i] % A_list_i[j]
        else:
            temp = A_list_i[j] % A_list_i[i]
        if temp > max_gcd:
            max_gcd = temp
        if temp < min_gcd[0]:
            min_gcd[0] = temp
            if A_list_i[i] > A_list_i[j]:
                min_gcd[1] = i
            else:
                min_gcd[1] = j
A_list_i[min_gcd[1]] = max_gcd
temp = 0
max_gcd = 1
for i in range(N-1):
    for j in range(i+1, N):
        if A_list_i[i] == A_list_i[j]:
            temp = A_list_i[i]
        elif A_list_i[i] > A_list_i[j]:
            temp = A_list_i[i] % A_list_i[j]
        else:
            temp = A_list_i[j] % A_list_i[i]
        if temp > max_gcd:
            max_gcd = temp            
print('%d' % max_gcd)