Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03612 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        cnt += 1
if p[-1] == n:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        cnt += 1
print(cnt)
Problem p03633 (python)

Fixed submission:
from functools import reduce
N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())
def gcd(x, y):
    while y > 0:
        x, y = y, x % y
    return x
def lcm(x, y):
    return x*y//gcd(x, y)
print(reduce(lcm, T))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
N = int(input())
T = [0]*N
for i in range(N):
    T[i] = int(input())
def lcm(a, b):
    return int((a*b)/gcd(a, b))
lcm_ans = lcm(T[0], T[1])
for i in range(N):
    lcm_ans = lcm(T[i], lcm_ans)
print(lcm_ans)
Problem p03636 (python)

Fixed submission:
s = input()
n = len(s) - 2
print(s[0]+str(n)+s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(s[0]+f'{len(s)-2}'+s[-1])
Problem p03640 (python)

Fixed submission:
h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
c = []
for i in range(n):
    c += [i+1]*a[i]
ans = []
for h_ in range(h):
    a = c[h_*w: w+h_*w]
    if h_ % 2 == 0:
        ans.append(a)
    else:
        ans.append(a[::-1])
for i in ans:
    print(*i)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
c = []
for i in range(n):
    c += [i+1]*a[i]
ans = []
for h_ in range(h):
    a = c[h_*w: w+h_*w]
    if h_ % 2 == 0:
        ans.append(a)
    else:
        ans.append(a[::-1])
for i in ans:
    print(*i)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
c = []
for i in range(n):
    c += (n+1)*a[n]
ans = []
for h_ in range(h):
    a = c[h_*w: w+h_*w]
    if h_ % 2 == 0:
        ans.append(a)
    else:
        ans.append(a[::-1])
for i in ans:
    print(*i)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
c = []
for i in range(n):
    c += (n+1)*a[n]
ans = []
for h_ in range(h):
    a = c[h*w: w+h*w]
    if h % 2 == 0:
        ans.append(a)
    else:
        ans.append(a[::-1])
for i in ans:
    print(*i)
Problem p03643 (python)

Fixed submission:
n = input()
print('ABC'+n)

Buggy submission (verdict: Runtime Error):
n = (input()
print('ABC'+n)
Problem p03645 (python)

Fixed submission:
n, m = map(int, input().split())
d = {i:[] for i in range(1, n)}
for i in range(m):
    a, b = map(int, input().split())
    d[a].append(b)
ans = "IMPOSSIBLE"
for dd in d[1]:
    if n in d[dd]:
        ans = "POSSIBLE"
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
keys = [0]*M
values = [0]*M
a = {}
for i in range(M):
    keys[i], values[i]= map(int, input().split())
a.update(zip(keys, values))
for i in range(M):
    if 1 in keys and N in values:
        a_one = a[1]
        if a[a_one] == N:
            print('POSSIBLE')
            exit()
    else:
        break
print('IMPOSSIBLE')
Problem p03696 (python)

Fixed submission:
n = int(input())
s = input()
cnt = 0
m = 0
for i in s:
    if i == ')':
        cnt += 1
    else:
        cnt -= 1
    m = max(m, cnt)
print('('*m+s+')'*(m-cnt))

Buggy submission (verdict: Runtime Error):
n = int(input())
s - input()
cnt = 0
m = 0
for i in s:
    if i == ')':
        cnt += 1
    else:
        cnt -= 1
    m = max(m, cnt)
print('()'*m+s+')'*(m-cnt))
Problem p03699 (python)

Fixed submission:
n = int(input())
s =[]
for i in range(n):
    s.append(int(input()))
s.sort()
if sum(s) % 10 != 0:
    print(sum(s))
else:
    a = sum(s)
    for i in range(n):
        if s[i] % 10 != 0:
            a = s[i]
            break
    print(sum(s) - a)

Buggy submission (verdict: Runtime Error):
n = int(input())
s =[]
for i in range(n):
    s.append(int(input()))
max_s = sum(s)
s.sort()
while str(max_s)[-1] == '0':
    max_s -= s[0]
    s.remove(s[0])
print(max_s)
Problem p03729 (python)

Fixed submission:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')
Problem p03737 (python)

Fixed submission:
s = list(input().split())
print(s[0][0].upper()+s[1][0].upper()+s[2][0].upper())

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split()))
print(s[0].upper()+s[1].upper()+s[2].upper())
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == 'D':
    if b == 'H':
        print('D')
    else:
        print('H')
else:
    if b == 'D':
        print('D')
    else:
        print('H')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a == 'D':
    if b == 'H':
        print('D')
    else:
        print('H')
else:
    if b == 'D':
        print('D')
    else:
        print('H')
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r ** 2)

Buggy submission (verdict: Runtime Error):
print(int(input) ** 2 * 3)
Problem p02993 (python)

Fixed submission:
s = input()

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] :
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
s = input()

if s[0] == s[1] or s[1] == s[2] or s[2] = s[3] :
  print("Bad")
else:
  print("Good")
Problem p03085 (python)

Fixed submission:
b = input()

if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "C":
  print("G")
elif b == "G":
  print("C")

Buggy submission (verdict: Runtime Error):
b = input()

if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "C":
  print("G")
else b == "G":
  print("C")
Problem p03125 (python)

Fixed submission:
a, b = map(int, input().split())

if b % a == 0:
    print(a + b)
else :
    print(b - a)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

n = int(input())
e = [int(i) for i in input().split()] 


answer = 5000000000000000000000000000000000

e.sort(reverse=True)
for i in range(0,n-2):
    for j in e[i+1:n-1]:
        if gcd(e[i],j) < answer:
            answer = gcd(e[i],j)
            
print(answer)
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
elif D == 22:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h1, h2 = map(int, input().split())
l = []
l.append(h1)
l.append(h2)
for i in range(N-2):
    h = int(input())
    global l
    if len(l) < K:
        l.append(h)
    elif len(l) >= K:
        if h > min(l):
            l[l.index(min(l))] = h
        if h < max(l):
            l[l.index(max(l))] = h
print(max(l) - min(l))
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())
print(X + Y // 2)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
e = [int(i) for i in input().split()]

temp = []
for i in e:
    temp.append(abs(t - i * 0.006 - a))
    
print(e)
print(temp)
print(temp.index(min(temp)) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(N):
    H = int(input())
    if abs(T - H*0.006) < diff:
        num = i + 1
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
e = [int(i) for i in input().split()]

temp = []
for i in e:
    temp.append(abs(t - i * 0.006 - a))
    
print(temp.index(min(temp)) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(1,N+1):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(N):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i + 1

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = [int(input()) for i in range(N)]
print(H.index(min(abs(int(T - H[i] * 0.006 - A)) for i in range(N))))

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = [int(input()) for i in range(N)]
print(H.index(min(abs(int(T - H[i] * 0.006) - A)) for i in range(N)))
Problem p03369 (python)

Fixed submission:
S = input()
count = 0
for s in S:
    if s == 'o':
        count += 1
print(700 + count*100)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
for s in S:
    if s == o:
        count += 1
print(700 + count*100)
Problem p03623 (python)

Fixed submission:
x, a, b = map(int,input().split())

if abs(x - a) < abs(x- b):
    print("A")
else :
    print("B")

Buggy submission (verdict: Runtime Error):
x, a, b = int(input().split())

if abs(x - a) < abs(x- b):
    print("A")
else :
    print("B")
Problem p03657 (python)

Fixed submission:
a, b = map(int, input().split())

if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0 :
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a % 3 == 0 or b % 3 == 0 or (a*b) % == 0 :
  print("Possible")
else:
  print("Impossible")
Problem p03693 (python)

Fixed submission:
a, b, c = map(int, input().split())
if (10*b + c) % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
count = 0
for i in s:
    if int(i) == 1:
        count += 1
print(count)
Problem p03777 (python)

Fixed submission:
a, b = map(str, input().split())

if a == "H" and b == "H":
  print("H")
elif a == "H" and b == "D":
  print("D")
elif a == "D" and b == "H":
  print("D")
elif a == "D" and b == "D":
  print("H")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a == "H" and b == "H":
  print("H")
elif a == "H" and b == "D":
  print("D")
elif a == "D" and b == "H":
  print("D")
elif a == "D" and b == "D":
  print("H")
Problem p03795 (python)

Fixed submission:
n = int(input())

print(n * 800 - (n // 15) * 200)

Buggy submission (verdict: Runtime Error):
n = int(input())

print(N * 800 - N // 15 * 200)
Problem p03844 (python)

Fixed submission:
a, op, b = map(str, input().split())

a = int(a)
b = int(b)

if op == "+":
  print(a + b)
else: 
  print(a - b)

Buggy submission (verdict: Runtime Error):
a, op, b = map(str, input().split())

a = int(a)
b = int(b)

if op == "+":
  print(a + b)
eles: 
  print(a - b)
Problem p03852 (python)

Fixed submission:
c = input()

if c == "a" or c == "i" or c == "u" or c == "e" or c == "o":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c = input()

if c == "a" or c == "i" or c == "u" ro c == "e" or c == "o":
  print("vowel")
else:
  print("consonant")
Problem p02582 (python)

Fixed submission:
import sys
input = sys.stdin.readline

s = input()
if s[1] == 'R':
    print(s.count('R'))
else:
    if s[0] == 'S' and s[2] == 'S':
        print(0)
    else:
        print(1)

Buggy submission (verdict: Runtime Error):
x, k, d = map(int, input().split())

x = abs(x)
k = k - int(x/d)
if k <= 0:
    print(x - k * d)
    exit()
    
a = x - int(x/d)*d
if k % 2 == 0:
    ans = a
else:
    ans = abs(a - d)

print(ans)
Problem p02584 (python)

Fixed submission:
x, k, d = map(int, input().split())

x = abs(x)
kk = k - int(x/d)
if kk <= 0:
    print(x - k * d)
    exit()

a = x - int(x/d)*d
if kk % 2 == 0:
    ans = a
else:
    ans = abs(a - d)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

x, k, d = map(int, input().split())
p_lst = list(range(0, k*d + 1, d))
n_lst = list(map(lambda x: -x, p_lst[1:]))
potential_pos = n_lst + p_lst
potential = [x + y for y in potential_pos]
potential.sort()
print(min(map(lambda x: max(x, -x), potential[0::2])))
Problem p02613 (python)

Fixed submission:
n, *s = open(0).read().split()
n = int(n)

c0 = s.count('AC')
c1 = s.count('WA')
c2 = s.count('TLE')
c3 = n - (c0 + c1 + c2)

print('AC x ' + str(c0), 'WA x ' + str(c1), sep='\n')
print('TLE x ' + str(c2), 'RE x ' + str(c3), sep='\n')

Buggy submission (verdict: Runtime Error):
n, *s = map(int, open(0).read().split())

c0 = s.count('AC')
c1 = s.count('WA')
c2 = s.count('TLE')
c3 = n - (c0 + c1 + c2)

print('AC x ' + str(c0), 'WA x ' + str(c1), sep='\n')
print('TLE x ' + str(c2), 'RE x ' + str(c3), sep='\n')
Problem p02658 (python)

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

try:
    idx = a.index(0)
    print(0)

except ValueError:

    ans = a[0]
    for i in range(1, len(a)):
        ans *= a[i]
        if ans > 10**18:
            print('-1')
            exit()

    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

def multi_lst(lst):
    ans = lst[0]
    for i in range(1, len(lst)):
        ans *= lst[i]
    
    return ans
if a.index(0):
    print(0)
    exit()
else:
    ans = multi_lst(a)

if ans <= 10**18:
    print(ans)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

def multi_lst(lst):
    ans = lst[0]
    for i in range(1, len(lst)):
        ans *= lst[i]
    
    return ans
if a.index(0):
    print(0)
else:
    ans = multi_lst(a)
    
if ans <= 10**18:
    print(ans)
else:
    print('-1')
Problem p02630 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
q = int(input())
u = []
for i in range(q):
    u.append(tuple(map(int,input().split())))

from collections import Counter
z = Counter(a)

sum = sum(a)
for i in range(q):
    try:
        rev = z.pop(u[i][0])
        sum+=(u[i][1]-u[i][0])*rev
        print(sum)
        if u[i][1] in z:
            z[u[i][1]]+=rev
        else:
            z[u[i][1]]=rev
    except KeyError:
        print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
u = []
for i in range(q):
    u.append(tuple(map(int,input().split())))

from collections import Counter
z = Counter(a)

sum = sum(a)
for i in range(q):
    try:
        rev = z.pop(u[i][0])
        sum+=(u[i][1]-u[i][0])*rev
        print(sum)
    except KeyError:
        print(sum)
    if u[i][1] in z:
        z[u[i][1]]+=rev
    else:
        z[u[i][1]]=rev

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
q = int(input())
u = []
for i in range(q):
    u.append(tuple(map(int,input().split())))

from collections import Counter
z = Counter(a)

sum = sum(a)
for i in range(q):
    try:
        rev = z.pop(u[i][0])
        sum+=(u[i][1]-u[i][0])*rev
        print(sum)
    except KeyError:
        print(sum)
    if u[i][1] in z.keys():
        z[u[i][1]]+=rev
    else:
        z[u[i][1]]=rev
Problem p02641 (python)

Fixed submission:
x,n=map(int,input().split())
p = list(map(int,input().split()))
p.sort()
b = []
for i in range(0,102):
    if not (i in p):
        b.append((i,abs(i-x)))

b.sort(key=lambda x:x[1])
print(b[0][0])

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
p = list(map(int,input().split()))
p.sort()
b = []
for i in range(1,101):
    if not (i in p):
        b.append((i,abs(i-x)))

b.sort(key=lambda x:x[1])
print(b[0][0])
Problem p02658 (python)

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

if sorted(a)[0]==0:
    print(0)
else:
    import math
    b = [math.log10(i) for i in a if i!=0]    
    if sum(b)>18:
        print(-1)
    else:
        z = 1
        for i in a:
            z*=i
        if z>10**18:
            print(-1)
        else:
            print(z)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
import math
b = [math.log10(i) for i in a]    
if sum(b)>18:
    print(-1)
else:
    z = 1
    for i in a:
        z*=i
    if z>10**18:
        print(-1)
    else:
        print(z)
Problem p02687 (python)

Fixed submission:
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
s = input()

if s = 'ABC':
    print('ARC')
else:
    print('ABC')
Problem p02690 (python)

Fixed submission:
x = int(input())

from collections import deque
z = []
u = deque([])
for a in range(0,1000):
    for b in range(-1000,1000):
        z.append(a**5-b**5)
        u.append((a,b))

for i in range(10**6+1):
    if z[i] == x:
        print(u[i][0],u[i][1])
        break

Buggy submission (verdict: Runtime Error):
x = int(input())

z = []
u = []
for a in range(1,100):
    for b in range(-100,100):
        z.append(a**5-b**5)
        u.append((a,b))

for i in range(10**9+1):
    if z[i] == x:
        print(u[i][0],u[i][1])
        break
Problem p02797 (python)

Fixed submission:
n,k,s = map(int,input().split())

u = []
if n == k:
    for i in range(n):
        u.append(s)
else:
    if s%2==0:
        for i in range(k+1):
            u.append(int(s/2))
        for i in range(n-k-1):
            u.append(10**9-1)
    else:
        if s==1:
            for i in range(k):
                u.append(1)
            for i in range(n-k):
                u.append(10**9)
        else:
            if k%2==0:
                u.append(int((s-1)/2))
                for i in range(int(k/2)):
                    u.append(int((s+1)/2))
                    u.append(int((s-1)/2))    
                for i in range(n-k-1):
                    u.append(10**9)
            else:
                for i in range(int((k+1)/2)):
                    u.append(int((s+1)/2))
                    u.append(int((s-1)/2))  
                for i in range(n-k-1):
                    u.append(10**9)
print(' '.join(map(str,u)))

Buggy submission (verdict: Runtime Error):
n,k,s = map(int,input().split())

u = []
if n == k:
    print(' '.join(str,[s]*n))
else:
    if s%2==0:
        for i in range(k+1):
            u.append(int(s/2))
        for i in range(n-k-1):
            u.append(10**9-1)
    else:
        if s==1:
            for i in range(k):
                u.append(1)
            for i in range(n-k-1):
                u.append(10**9)
        else:
            if k%2==0:
                u.append(int((s-1)/2))
                for i in range(int(k/2)):
                    u.append(int((s+1)/2))
                    u.append(int((s-1)/2))    
                for i in range(n-k+1):
                    u.append(10**9)
            else:
                for i in range(int(k/2)):
                    u.append(int((s+1)/2))
                    u.append(int((s-1)/2))  
                for i in range(n-k+1):
                    u.append(10**9)
print(' '.join(map(str,u)))
Problem p02963 (python)

Fixed submission:
s = int(input())
import math
k = math.floor(s**0.5)
m = 0
if s == 10**18:
    print(10**9,0,0,10**9,0,0)
else:
    if k**2+k < s:
        m = (k+1)**2 -s
        print(k+1,1,m,k+1,0,0)
    else:
        m = k*(k+1)-s
        print(k+1,1,m,k,0,0)

Buggy submission (verdict: Runtime Error):
s = int(input())
import math
k = math.floor(s**0.5)
m = 0
if s = 10**18:
    print(10**9,0,0,10**9,0,0)
else:
    if k**2+k < S:
        m = (k+1)**2 -s
        print(k+1,1,m,k+1,0,0)
    else:
        m = k*(k+1)-s
        print(k+1,1,m,k,0,0)
Problem p03244 (python)

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

a = [v[2*i] for i in range(int(n/2))]
b = [v[2*i+1] for i in range(int(n/2))]

from collections import Counter

x = Counter(a)
y = Counter(b)
x = list(x.items())
y = list(y.items())
x.sort(reverse=1,key=lambda p: p[1])
y.sort(reverse=1,key=lambda p: p[1])

if x[0][0] != y[0][0]:
    print(n-x[0][1]-y[0][1])
else:
    if x[0][0] == y[0][0]:
        if min(len(x),len(y))>=2:
            print(n-max(x[0][1]+y[1][1],y[0][1]+x[1][1]))
        elif len(x)==2:
            print(n-x[1][1]-y[0][1])
        elif len(y)==2:
            print(n-y[1][1]-x[0][1])
        else:
            print(int(n/2))

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))

a = [v[2*i] for i in range(int(n/2))]
b = [v[2*i+1] for i in range(int(n/2))]

from collections import Counter

x = Counter(a)
y = Counter(b)
x = list(x.items())
y = list(y.items())
x.sort(reverse=1,key=lambda p: p[1])
y.sort(reverse=1,key=lambda p: p[1])

if x[0][0] != y[0][0]:
    print(n-x[0][1]-y[0][1])
else:
    if x[0][0] == y[0][0]:
        if min(len(x),len(y))>=2:
            print(n-max(x[0][1]+y[1][1],y[0][1]+x[1][1]))
        elif len(x)==2:
            print(n-x[1][1]-y[0][1])
        else:
            print(n-y[1][1]-x[0][1])

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))

a = [v[2*i] for i in range(int(n/2))]
b = [v[2*i+1] for i in range(int(n/2))]

from collections import Counter

x = Counter(a)
y = Counter(b)
x = list(x.items())
y = list(y.items())
x.sort(reverse=1,key=lambda p: p[1])
y.sort(reverse=1,key=lambda p: p[1])

if x[0][0] != y[0][0]:
    print(n-x[0][1]-y[0][1])
else:
    if x[0][0] == y[0][0]:
        print(n-max(x[0][1]+y[1][1],y[0][1]+x[1][1]))
Problem p02554 (python)

Fixed submission:
n=int(input())
print((10**n-(2*9**n-8**n))%(10**9+7))

Buggy submission (verdict: Runtime Error):
n=input()
print((10**n-(2*9**n-8**n))%(10**9+7))
Problem p03061 (python)

Fixed submission:
from functools import reduce
from fractions import gcd
N =  int(input())
A =  list(map(int, (input().split(' '))))

from itertools import accumulate

gcds = []
left_all_gcd = list(accumulate(A, gcd))
right_all_gcd = list(accumulate(A[::-1], gcd))
for i in range(len(A)):
    if i == 0:
        gcds.append(right_all_gcd[-2])
    if i == len(A)-1:
        gcds.append(left_all_gcd[-2])
    else:
        hoge = [left_all_gcd[i-1]] + [right_all_gcd[-i-1]]
        gcds.append(gcd(left_all_gcd[i-1], right_all_gcd[-i-2]))

print(max(gcds))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
N =  int(input())
A =  list(map(int, (input().split(' '))))


gcds = []
for i in range(len(A)):
    A[:i] + A[i+1:]
    gcds.append(reduce(gcd, A[:i]+A[i+1:]))

print(max(gcds))