Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
for N in range(n):
    gcds = max(gcds,reduce(fractions.gcd, a[:N] + a[N+1:]))
print(gcds)

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
for N in range(n):
    gcds = max(gcds,reduce(fractions.gcd, a[:N],a[N+1:]))
print(gcds)

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcds = max(gcds,reduce(fractions.gcd, b))
print(max(gcds))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = []
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcds.append(reduce(fractions.gcd, b))
print(max(gcds))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
import functools
import math
gcds = []
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcds.append(functools.reduce(math.gcd, b))
print(max(gcds))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):
import functools
import math
n = int(input())
a = list(map(int,input().split()))
gcd = []
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcd.append(functools.reduce(math.gcd, b))
print(max(gcd))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):

import functools
import math
n = int(input())
a = list(map(int,input().split()))
gcd = []
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcd.append(functools.reduce(math.gcd, b))
print(max(gcd))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)

Buggy python submission (verdict: Runtime Error):

import functools
import math
import copy
n = int(input())
a = list(map(int,input().split()))
gcd = []
for N in range(n):
    b = copy.copy(a)
    b.remove(b[N])
    gcd.append(functools.reduce(math.gcd, b))
print(max(gcd))

Fixed submission:

import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)