Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
mod = 1000000007
fact = []
fact_inv = []
pow_ = []

def pow_ini(nn):
	global pow_
	pow_.append(nn)
	for j in range(62):
		nxt = pow_[j] * pow_[j]
		nxt %= mod
		pow_.append(nxt)
	return

def pow1(k):
    ansk = 1
    for ntmp in range(62):
        if((k >> ntmp) % 2 == 1):
            ansk *= pow_[ntmp]
            ansk %= mod
    return ansk

def fact_ini(n):
	global fact
	global fact_inv
	for i in range(n + 1):
		fact.append(0)
		fact_inv.append(0)
	fact[0] = 1
	for i in range(1, n + 1, 1):
		fact_tmp = fact[i - 1] * i
		fact_tmp %= mod
		fact[i] = fact_tmp
	pow_ini(fact[n])
	fact_inv[n] = pow1(mod - 2)
	for i in range(n - 1, -1, -1):
		fact_inv[i] = fact_inv[i + 1] * (i + 1)
		fact_inv[i] %= mod
	return

def nCm(n, m):
	assert(m >= 0)
	assert(n >= m)
	ans = fact[n] * fact_inv[m]
	ans %= mod
	ans *= fact_inv[n - m]
	ans %= mod
	return ans;

def nPm(n, m):
	assert(m >= 0)
	assert(n >= m)
	ans = fact[n]
	ans *= fact_inv[n - m]
	ans %= mod
	return ans;

fact_ini(5500000)
N, M = (int(x) for x in input().split())
ans = 0
for i in range(0, N+1, 1):
	anstmp = nCm(N, i) * nPm(M-i, N-i)
	anstmp %= mod
	if(i%2 == 1):
		anstmp *= -1
		anstmp += mod
		anstmp %= mod
	ans += anstmp
	ans %= mod
ans *= nPm(M, N)
ans %= mod
print(ans)

Fixed submission:
mod = 1000000007
fact = []
fact_inv = []
pow_ = []

def pow_ini(nn):
	global pow_
	pow_.append(nn)
	for j in range(62):
		nxt = pow_[j] * pow_[j]
		nxt %= mod
		pow_.append(nxt)
	return

def pow1(k):
    ansk = 1
    for ntmp in range(62):
        if((k >> ntmp) % 2 == 1):
            ansk *= pow_[ntmp]
            ansk %= mod
    return ansk

def fact_ini(n):
	global fact
	global fact_inv
	for i in range(n + 1):
		fact.append(0)
		fact_inv.append(0)
	fact[0] = 1
	for i in range(1, n + 1, 1):
		fact_tmp = fact[i - 1] * i
		fact_tmp %= mod
		fact[i] = fact_tmp
	pow_ini(fact[n])
	fact_inv[n] = pow1(mod - 2)
	for i in range(n - 1, -1, -1):
		fact_inv[i] = fact_inv[i + 1] * (i + 1)
		fact_inv[i] %= mod
	return

def nCm(n, m):
	assert(m >= 0)
	assert(n >= m)
	ans = fact[n] * fact_inv[m]
	ans %= mod
	ans *= fact_inv[n - m]
	ans %= mod
	return ans;

def nPm(n, m):
	assert(m >= 0)
	assert(n >= m)
	ans = fact[n]
	ans *= fact_inv[n - m]
	ans %= mod
	return ans;

fact_ini(5500000)
N, M = (int(x) for x in input().split())
ans = 0
for i in range(0, N+1, 1):
	anstmp = nCm(N, i) * nPm(M-i, N-i)
	anstmp %= mod
	if(i%2 == 1):
		anstmp *= -1
		anstmp += mod
		anstmp %= mod
	ans += anstmp
	ans %= mod
ans *= nPm(M, N)
ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
A = Input()
B = Input()

if 1 <= A <= 9 and 1 <= B <= 9:
    print(A * B)
else:
    print(-1)


Fixed submission:
A, B = map(int, input().split())
if 1 <= A <= 9 and 1 <= B <= 9:
    print(A * B)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, heapify
import copy
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


n = I()
ans = 0
for i in range(1, n):
    cnt = 0
    for j in range(1, int(i**0.5)+1):
        if i % j == 0:
            cnt += 1
            if j != i // j:
                cnt += 1
    ans += cnt

print(ans)


Fixed submission:
# coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop, heapify
import copy
import sys
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


n = I()
ans = 0
for a in range(1, n):
    ans += (n-1)//a

print(ans)
Buggy python submission (verdict: Runtime Error):
r =int(input())
return int(r**2)

Fixed submission:
r = int(input())
print(int(r**2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
import math 
arr = []
for i in range(1,math.floor(n**0.5)):
  if n % i == 0:
    arr.append(i+n/i)
print(int(min(arr)-2))

Fixed submission:
n = int(input())
import math 
arr = []
for i in range(1,n):
  if i > math.ceil(n**0.5):
    break
  if n % i == 0:
    arr.append(i+n/i-2)
print(int(min(arr)))
Buggy python submission (verdict: Runtime Error):
import bisect

n = int(input())
l = list(int(i) for i in input().split())
l = sorted(l, reverse=True)

cnt = 0

for i in range(n - 2):
    a = l[i]
    for j in range(i + 1, n-1):
        b = l[j]
        cnt += bisect.bisectright(l, a-b)-(j+1)

print(cnt)


Fixed submission:
import bisect


def main():
    n = int(input())
    l = sorted(list(int(i) for i in input().split()))

    cnt = 0

    for i in range(n - 2):
        a = l[i]
        for j in range(i + 1, n-1):
            b = l[j]
            cnt += bisect.bisect_left(l, a+b)-(j+1)

    print(cnt)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
n = int(input())
l = list(int(i) for i in input().split())

cnt = 0

for bars in comb(l, 3, exact=True):
    a, b, c = bars[0], bars[1], bars[2]
    if a < b + c and b < a + c and c < b + a:
        cnt += 1

print(cnt)


Fixed submission:
import bisect


def main():
    n = int(input())
    l = sorted(list(int(i) for i in input().split()))

    cnt = 0

    for i in range(n - 2):
        a = l[i]
        for j in range(i + 1, n-1):
            b = l[j]
            cnt += bisect.bisect_left(l, a+b)-(j+1)

    print(cnt)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
l = list(int(i) for i in input().split())

cnt = 0

for bars in combinations(l, 3):
    a,b,c = bars[0], bars[1], bars[2]
    if a < b + c and b < a + c and c < b + a:
        cnt+=1

print(cnt)




Fixed submission:
import bisect


def main():
    n = int(input())
    l = sorted(list(int(i) for i in input().split()))

    cnt = 0

    for i in range(n - 2):
        a = l[i]
        for j in range(i + 1, n-1):
            b = l[j]
            cnt += bisect.bisect_left(l, a+b)-(j+1)

    print(cnt)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(x) for x in input().split()]
ans =[]
mm=1
for i in range(n):
  ans.append(a.index(mm)+1)
  mm+=1
print(*ans)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
vl =[]
tmp =[]
ans=[0]*n
for i,value in enumerate(a):
  tmp.append(i)
  vl.append(value)
for i in range(n):
  ans[vl[i]-1]=tmp[i]+1
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(x) for x in input().split()]
ans =[]
mm=1
for i in range(n):
  tmp = a.index(mm)
  ans.append(tmp+1)
  mm+=1
print(*ans)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
vl =[]
tmp =[]
ans=[0]*n
for i,value in enumerate(a):
  tmp.append(i)
  vl.append(value)
for i in range(n):
  ans[vl[i]-1]=tmp[i]+1
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(x) for x in input().split()]
ans =[]
mm=1
for i in range(n):
  for j in range(n):
    if mm==a[j]:
      ans.append(j+1)
      mm+=1
      break
print(*ans)

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
vl =[]
tmp =[]
ans=[0]*n
for i,value in enumerate(a):
  tmp.append(i)
  vl.append(value)
for i in range(n):
  ans[vl[i]-1]=tmp[i]+1
print(*ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

beaten_monster_num = 0

for i in range(n):
    if a[i] <= b[i]:
        if a[i+1] >= b[i] - a[i]:
            beaten_monster_num += b[i]
            a[i+1] -= b[i] - a[i]
        else:
            beaten_monster_num += a[i] + a[i+1]
            a[i+1] = 0
    elif a[i] - b[i] <= b[i+1]:
        beaten_monster_num += a[i]
        b[i+1] -= a[i] - b[i]
    else:
        beaten_monster_num += b[i] + b[i+1]
        b[i+1] = 0

print(int(beaten_monster_num))

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

beaten_monster_num = 0

for i in range(n):
    if a[i] <= b[i]:
        if a[i+1] >= b[i] - a[i]:
            beaten_monster_num += b[i]
            a[i+1] -= b[i] - a[i]
        else:
            beaten_monster_num += a[i] + a[i+1]
            a[i+1] = 0
    else:
        beaten_monster_num += b[i]

print(int(beaten_monster_num))
Buggy python submission (verdict: Runtime Error):
import math


# def calc(n, c, d):
#     return n-(math.floor(n / c) +
#               math.floor(n / d) - math.floor(n / (c * d / math.gcd(c, d))))
def calc(n, c, d):
    return n-(n / c +
              n / d - n / (c * d / gcd(c, d)))


def main():
    a, b, c, d = map(int, input().split())

    print(calc(b, c, d)-calc(a-1, c, d))


if __name__ == "__main__":
    main()


Fixed submission:
a,b,c,d=map(int,input().split())
from math import gcd
ans=0
def main(n):
    e=n//c+n//d-n//((c*d)//gcd(c,d))
    return n-e

print(main(b)-main(a-1))
Buggy python submission (verdict: Runtime Error):
r,D,x = map(int, input().split())

for i in range(10):
  x = r*x - D
  print(x)

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))

Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
 
if 6 <= A and A < 13:
  B /= 2
else if A < 6:
  B = 0
  
print(B)

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))

Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())

if A >= 13:
  print(B)
else if A > 5:
  print(B/2)
else :
  print(0)  

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))

Buggy python submission (verdict: Runtime Error):
if age >= 13 :
    return money
else if age > 5 :
    return money / 2
else:
    return 0

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))

Buggy python submission (verdict: Runtime Error):
def fun(A,B):
  if A >= 13 :
    return B
  else if A > 5 :
    return B / 2
  else:
    return 0

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))

Buggy python submission (verdict: Runtime Error):
def fun(age,money):
  if age >= 13 :
    return money
  else if age > 5 :
    return money / 2
  else:
    return 0

Fixed submission:
A,B = map(int, input().split())
 
if A < 6:
  B = 0
elif (6 <= A) and (A < 13):
  B /= 2
else :
  pass
  
print(int(B))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
numSet = set(range(1,n+1))
for i in range(m):
  l,r = map(int,input().split())
  numSet &= set(range(l,r+1))
print(len(numSet))


Fixed submission:
n,m = map(int,input().split())
numSet = set(range(1,n+1))
L,R = [],[]
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)
if min(R) >= max(L):
  print(min(R)-max(L)+1)
else:
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
numSet = set(range(1,n+1))
for i in range(m):
  l,r = map(int,input().split())
  numSet &= set(range(l,r+1))
print(len(numSet))

Fixed submission:
n,m = map(int,input().split())
numSet = set(range(1,n+1))
L,R = [],[]
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)
if min(R) >= max(L):
  print(min(R)-max(L)+1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
import math
 
S = int(input())
 
first_half = math.floor(S / 100)
second_half = S - first_half * 100
 
if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
   		print("YYMM")
elif 1 <= first_half <= 12 :
    	print("MMYY")
else: 
        print("NA")

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Buggy python submission (verdict: Runtime Error):
import math

S = int(input())

first_half = math.floor(S / 100)
second_half = S - first_half * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 0 == first_half or 12 < first_half :
    	print("NA")
  else: 
        print("MMYY")

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Buggy python submission (verdict: Runtime Error):
import math

S = int(input())

first_half = math.floor(S / 100)
second_half = S - math.floor(S / 100) * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 0 == first_half or 12 < first_half :
    	print("NA")
  else: 
        print("MMYY")

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Buggy python submission (verdict: Runtime Error):
S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
  elif 1 <= first_half <= 12 :
    	print("MMYY")
  else: 
        print("NA")

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Buggy python submission (verdict: Runtime Error):
S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
    print("YYMM")
elif 1 <= first_half <= 12 :
    print("MMYY")
else: 
    print("NA")

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K] = letters[K].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)

Fixed submission:
N,K = map(int,input().split())
S = input()

letters = list(S)
letters[K-1] = letters[K-1].lower()

new_S = ""

for letter in letters:
  new_S += letter
  
print(new_S)
Buggy python submission (verdict: Runtime Error):
S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
else:
  if 1 <= second_half <= 12 :
   		print("YYMM")
	elif 1 <= first_half <= 12 :
    	print("MMYY")
	else: 
        print("NA")

Fixed submission:
import math

S = int(input())

first_half = math.floor(S / 100)
second_half = S - first_half * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
   		print("YYMM")
elif 0 == first_half or 12 < first_half :
    	print("NA")
else: 
        print("MMYY")

Buggy python submission (verdict: Runtime Error):
S = int(input())

first_half = round(S, -2) / 100
second_half = S - round(S, -2)

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
  elif 1 <= second_half <= 12 :
    print("YYMM")
  elif 1 <= first_half <= 12 :
    print("MMYY")
  else: 
    print("NA")

Fixed submission:
import math

S = int(input())

first_half = math.floor(S / 100)
second_half = S - first_half * 100

if 1 <= second_half <= 12 and 1 <= first_half <= 12 :
  print("AMBIGUOUS")
elif 1 <= second_half <= 12 :
   		print("YYMM")
elif 0 == first_half or 12 < first_half :
    	print("NA")
else: 
        print("MMYY")
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))

for i in range(n):
  profit = v[i] - c[i]

max_profit = np.sum(profit[profit>0])
print(max_profit)

Fixed submission:
import numpy as np
n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))

profit = v - c

max_profit = np.sum(profit[profit>0])
print(max_profit)
Buggy python submission (verdict: Runtime Error):
n = int(input())
height = list(map(int,input().split()))

no_ocean = 0

for i in range(1,n):
  for k in range(i):
    if height[k] > height[i]:
      	no_ocean += 1
      	break
    else:
        continue
        
print(n - no_ocean)
    

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

for i in range(2):
  if a > b:
    coins += a
    a-=1
  else:
    coins += b
    b-=1
  
print(coins)

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

if a >= b + 2:
  coins = 2 * a - 1
elif b + 2 >= a:
  coins = 2 * b - 1
else:
  coins = a + b
  
print(coins)

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

for i in range(2):
  if a > b:
    coins += a
    a-=1
  else:
    coins += b
    b-=1
  
print(coins)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
for i in range(n):
  k,a = input().split()[0] , input().split()[1:]
count = 0
for i in range(n):
  if a.count(k[i]) == n:
    count += 1
print(count)
  


Fixed submission:
n,m = map(int, input().split())
ans = list(input().split())
ans = set(ans[1:])
for i in range(n-1):
    b = list(input().split())
    b = set(b[1:])
    ans = ans & b
print(len(ans))
Buggy python submission (verdict: Runtime Error):
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import sys
INF = float('inf')
mod = 10**9+7


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    lst = LI()
    print(gcd(lst))


if __name__ == "__main__":
    main()


Fixed submission:
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import sys
INF = float('inf')
mod = 10**9+7


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    lst = LI()
    ans = lst[0]
    for i in range(1, n):
        ans = gcd(ans, lst[i])
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(i) for _ in input().split()]
if max(l) < sum(l) - max(l):
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
if max(l) < sum(l) - max(l):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,T = map(int, input().split())
i = 1001
 
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T:
    i = min(i, c)

if i == 1001:
  print('TLE')
else:
  print(i)

Fixed submission:
N, T = map(int, input().split())
i = 1001
 
for _ in range(N):
  c, t = map(int, input().split())
  if t <= T:
    i = min(i, c)

if i == 1001:
  print('TLE')
else:
  print(i)