Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()
t= input()
# s = "abracadabra"
# t = "avadakedavra"

dp=[[0]*len(t) for i in range(len(s))]
for i in range(len(s)):
    for j in range(len(t)):
        if s[i-1] == t[j-1]:
            dp[i][j] = dp[i-1][j-1] + 1
        else:
            dp[i][j] = max(dp[i][j-1], dp[i-1][j])
            
i, j, dp_len = len(s),len(t), dp[-1][-1]
ans = ""

while dp_len:
#     print("現在精査している文字は{}と{}です。もとのsは{}で、tは{}です。sの長さは{}, tの長さは{}です".format(s[i-1],t[j-1],s[:i-1], t[:j-1], i,j))
    if s[i-1] == t[j-1]:
        ans += s[i-1]
        i -= 1
        j -= 1
        dp_len -= 1
#         print("一致")
    elif dp[i][j] == dp[i-1][j]:
        i -= 1
    else:
        j -= 1
        
# print(dp)
print(ans[::-1])

Fixed submission:
S = input()
T = input()
 
# dp[i][j] := Sのi文字目, Tのj文字目まで見た場合のLCS
dp = [[0] * (len(T) + 1) for i in range(len(S) + 1)]
 
for i in range(1, len(S) + 1):
    for j in range(1, len(T) + 1):
        if S[i - 1] == T[j - 1]:
            dp[i][j] = dp[i - 1][j - 1] + 1
        else:
            dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
 
ans = ''
i, j = len(S), len(T)
while i > 0 and j > 0:
    if S[i - 1] == T[j - 1]:
        ans += S[i - 1]
        i, j = i - 1, j - 1
    elif dp[i][j - 1] > dp[i - 1][j]:
        j -= 1
    else:
        i -= 1
 
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
s = input()
t= input()
dp=[[0]*len(s) for i in range(len(t))]
for i in range(len(t)):
    for j in range(len(s)):
        if t[i] == s[j]:
            dp[i][j] = dp[i-1][j-1] + 1
        else:
            dp[i][j] = max(dp[i][j-1], dp[i-1][j])
i, j = len(s),len(t)
ans = ""
while i>0 and j > 0:
    if s[i-1] == t[j-1]:
        ans += s[i-1]
        i -= 1
        j -= 1
    elif dp[j][i] > dp[j-1][i]:
        j -= 1
    else:
        i -= 1
print(ans[::-1])

Fixed submission:
S = input()
T = input()
 
# dp[i][j] := Sのi文字目, Tのj文字目まで見た場合のLCS
dp = [[0] * (len(T) + 1) for i in range(len(S) + 1)]
 
for i in range(1, len(S) + 1):
    for j in range(1, len(T) + 1):
        if S[i - 1] == T[j - 1]:
            dp[i][j] = dp[i - 1][j - 1] + 1
        else:
            dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
 
ans = ''
i, j = len(S), len(T)
while i > 0 and j > 0:
    if S[i - 1] == T[j - 1]:
        ans += S[i - 1]
        i, j = i - 1, j - 1
    elif dp[i][j - 1] > dp[i - 1][j]:
        j -= 1
    else:
        i -= 1
 
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
hn = [int(input()) for i in range(n)]

hn.sort()

print(min(hn[i+k-1] - hn[i] for i in range(i-k+1)))

Fixed submission:
n,k = map(int,input().split())
hn = [int(input()) for i in range(n)]

hn.sort()

print(min(hn[i+k-1] - hn[i] for i in range(n-k+1)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
hn = [int(input()) for i in range(n)]

# 方針として、高さの違いをソートして小さい順からk-1個取得すればよい
hn.sort()

print(hn)

print(min(hn[i+k-1] - hn[i] for i in range(i-k+1)))

Fixed submission:
n,k = map(int,input().split())
hn = [int(input()) for i in range(n)]

hn.sort()

print(min(hn[i+k-1] - hn[i] for i in range(n-k+1)))
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
# 問題はM//N>xを満たすようなMの約数xの中で最小のものと読み替えられる。
bdr = M//N
ans = 1
for i in range(1,M):
    if M%i==0:
        if i<=bdr:
            ans = i
        if i>bdr:
            break
print(ans)

Fixed submission:
N,M = map(int,input().split())
# 問題はM//N>xを満たすようなMの約数xの中で最小のものと読み替えられる。
bdr = M//N
ans = 1

for i in range(1,int(M**0.5+1)):
    if M%i==0:
        yakusu = M//i
        if yakusu<=bdr:
            ans = yakusu
            break
        elif i <= bdr:
            ans = i
print(ans)
Buggy python submission (verdict: Runtime Error):
### from collections import Counter

n = int(input())
vn = list(map(int,input().split()))
vn_odd = [vn[i] for i in range(n) if i%2==1]
vn_even = [vn[i] for i in range(n) if i%2==0]
odd_freq = Counter(vn_odd).most_common(2)
even_freq = Counter(vn_even).most_common(2)

ans = 0

if odd_freq[0][0] != even_freq[0][0]:
    ans += n - odd_freq[0][1] - even_freq[0][1]
else:
    ans += n - max(odd_freq[0][1]+even_freq[1][1], odd_freq[1][1]+even_freq[0][1])
            
print(ans)


Fixed submission:
import collections
 
def counter_top(c, exclude):
  for a in c.most_common():
    if a[0] != exclude:
      return a
  return (object(), 0)
 
def conv_seq(seq, exclude=None):
  c = collections.Counter(seq)
  mc = counter_top(c, exclude)
  return sum(c.values()) - mc[1], mc[0]
 
input()
vals = list(map(int, input().split()))
s1, a = conv_seq(vals[::2])
s2, b = conv_seq(vals[1::2])
if a != b:
  print(s1 + s2)
else:
  s1_new, _ = conv_seq(vals[::2], exclude=b)
  s2_new, _ = conv_seq(vals[1::2], exclude=a)
  print(min(s1_new + s2, s1 + s2_new))

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
vn = list(map(int,input().split()))
vn_odd = [vn[i] for i in range(n) if i%2==1]
vn_even = [vn[i] for i in range(n) if i%2==0]
odd_freq = Counter(vn_odd).most_common(2)
even_freq = Counter(vn_even).most_common(2)

ans = 0

if odd_freq[0][0] != even_freq[0][0]:
    ans += n - odd_freq[0][1] - even_freq[0][1]
else:
    if odd_freq[0][1] > even_freq[0][1]:
        ans += n - odd_freq[0][1] - even_freq[1][1]
    elif odd_freq[0][1] < even_freq[0][1]:
        ans += n - odd_freq[1][1] - even_freq[0][1]
    else:
        if odd_freq[1][1] >= even_freq[1][1]:
            ans += n - odd_freq[1][1] - even_freq[0][1]
        else:
            ans += n - odd_freq[0][1] - even_freq[1][1]

            
print(ans)


Fixed submission:
import collections
 
def counter_top(c, exclude):
  for a in c.most_common():
    if a[0] != exclude:
      return a
  return (object(), 0)
 
def conv_seq(seq, exclude=None):
  c = collections.Counter(seq)
  mc = counter_top(c, exclude)
  return sum(c.values()) - mc[1], mc[0]
 
input()
vals = list(map(int, input().split()))
s1, a = conv_seq(vals[::2])
s2, b = conv_seq(vals[1::2])
if a != b:
  print(s1 + s2)
else:
  s1_new, _ = conv_seq(vals[::2], exclude=b)
  s2_new, _ = conv_seq(vals[1::2], exclude=a)
  print(min(s1_new + s2, s1 + s2_new))
Buggy python submission (verdict: Runtime Error):
S=input()
T = input()

checked_s=[0]*26

for i in range(len(S)):
    if S[i] != T[i]:
        if T[i] in S:
            S = S.translate(str.maketrans({S[i]:T[i], T[i]: S[i]}))
        elif checked_s[i] == 0:
            S = S.replace(S[i], T[i])
            
if S==T:
    print("Yes")
else:
    print("No")

Fixed submission:
from collections import Counter
 
S = input()
T = input()
 
s = Counter(S)
t = Counter(T)
 
if sorted(s.values()) == sorted(t.values()):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

# 素因数分解して、重複組み合わせを数える。
n,m = map(int,input().split())
MOD = 10**9+7

# 素因数分解
def factorize(n):
    fct = [] # Prime Factor
    b, e = 2, 0
    while b*b <= n:
        while n % b == 0:
            n //= b
            e += 1
        if e > 0:
            fct.append((b,e))
        b, e = b+1, 0
    if n>1:
        fct.append((n,1))
    return fct

# 組み合わせ計算(nCr)
def nCr(n,r):
    r = min(r,n-r)
    if r == 0:
        return 1
    over = reduce(mul, range(n,n-r,-1))
    under = reduce(mul,range(1,r+1))
    return over // under

f = factorize(m)
ans=1
for p,num in f:
    ans *= nCb(num+n-1,num)
    ans %= 10**9+7
 
print(ans)

Fixed submission:
from operator import mul
from functools import reduce

# 素因数分解して、重複組み合わせを数える。
n,m = map(int,input().split())
MOD = 10**9+7

# 素因数分解
def factorize(n):
    fct = [] # Prime Factor
    b, e = 2, 0
    while b*b <= n:
        while n % b == 0:
            n //= b
            e += 1
        if e > 0:
            fct.append((b,e))
        b, e = b+1, 0
    if n>1:
        fct.append((n,1))
    return fct

# 組み合わせ計算(nCr)
def nCr(n,r):
    r = min(r,n-r)
    if r == 0:
        return 1
    over = reduce(mul, range(n,n-r,-1))
    under = reduce(mul,range(1,r+1))
    return over // under

f = factorize(m)
ans=1
for p,num in f:
    ans *= nCr(num+n-1,num)
    ans %= MOD
    
print(ans)
Buggy python submission (verdict: Runtime Error):
from functools import reduce
import fractions

N,X = map(int,input().split())
xn = list(map(int,input().split()))
xn.append(X)
xn.sort()
distance = [xn[i]-xn[i-1] for i in range(1,N)]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(distance))

Fixed submission:
from functools import reduce
import fractions

N,X = map(int,input().split())
xn = list(map(int,input().split()))

distance = [abs(X-xn[i]) for i in range(N)]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(distance))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
import fractions

N,X = map(int,input().split())
xn = list(map(int,input().split()))
xn.sort()
distance = [xn[i]-xn[i-1] for i in range(1,N)]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(distance))

Fixed submission:
from functools import reduce
import fractions

N,X = map(int,input().split())
xn = list(map(int,input().split()))

distance = [abs(X-xn[i]) for i in range(N)]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(distance))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
    print("C is {}, ans is {}".format(C,ans))
print(ans)

Fixed submission:
N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
=int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)

Fixed submission:
n =int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())
S = []
ans = ""
for i in range(N):
  S.append(input())
sorted(S)
for i in range(len(S)):
  ans += S[i]
print(ans)


Fixed submission:
a=list(map(int,input().split()))
if a.count(5)==2 and a.count(7)==1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(Math.pow(3,n))

Fixed submission:
n = int(input())
p = n**3
print(p)
Buggy python submission (verdict: Runtime Error):
import math

N, K = list(map(int, input().split()))

proba = 0

for i in range(1, k):
  n_coin = int(math.log(k/i,2)) + 1
  print(i, n_coin)
  proba += float(1)/n*((0.5)**n_coin)

if n >= k:
	proba += float(n-k+1)/n


Fixed submission:
inputstr1 = input().split()
n = inputstr1[0]
k = inputstr1[1]
s = input()
 
N = int(n)
K = int(k)

ret = ""

for i in range(N):
  if i != K-1:
    ret += s[i]
  else:
    ret += s[i].lower()

print(ret)

Buggy python submission (verdict: Runtime Error):
n, k = [int(e) for e in input().split()]
s = input()
s[k] = s[k].lower()
print(s)

Fixed submission:
inputstr1 = input().split()
n = inputstr1[0]
k = inputstr1[1]
s = input()
 
N = int(n)
K = int(k)

ret = ""

for i in range(N):
  if i != K-1:
    ret += s[i]
  else:
    ret += s[i].lower()

print(ret)
Buggy python submission (verdict: Runtime Error):
t = "Yay!"
f = ":("

antennas = [input() for _ in range(5)]
k = input()

if max(antennas) <= k:
  print(t)
else:
  flag = True
  for i in antennas:
    for j in antennas:
      if abs(i-j) >= k:
        flag = False
  if flag: print(t)
  else: print(f)
    

Fixed submission:
t = "Yay!"
f = ":("

antennas = [int(input()) for _ in range(5)]
k = int(input())

if max(antennas) <= k:
    print(t)
else:
    flag = True
    for i in antennas:
        for j in antennas:
            if abs(i - j) >= k:
                flag = False
    if flag:
        print(t)
    else:
        print(f)
Buggy python submission (verdict: Runtime Error):
import math
dishes = [int(input()) for _ in range(5)]
lead_times = [int(math.ceil(t/10))*10 - t in dishes]
max_idx = lead_times.index(max(lead_times))
result = 0
for i in range(5):
  result += dishes[i]
  if i != max_idx:
    result += lead_times[i]
print(result)

Fixed submission:
import math
dishes = [int(input()) for _ in range(5)]
lead_times = [int(math.ceil(t/10))*10 - t for t in dishes]
max_idx = lead_times.index(max(lead_times))
result = 0
for i in range(5):
  result += dishes[i]
  if i != max_idx:
    result += lead_times[i]
print(result)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print('LESS' if A < B else 'GREATER' if A > B else 'EQUAL')

Fixed submission:
s1, s2, s3 = input().split()


print((s1[0] + s2[0] + s3[0]).upper())

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print('LESS' if A < B else 'GREATER' if A > B else 'EQUAL')

Fixed submission:
s1, s2, s3 = input().split()


print((s1[0] + s2[0] + s3[0]).upper())
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print('LESS' if A < B else 'GREATER' A > B else 'EQUAL')

Fixed submission:
A = int(input())
B = int(input())

if A < B:
    print('LESS')
elif A > B:
    print('GREATER')
else:
    print('EQUAL')
Buggy python submission (verdict: Runtime Error):
W, a, b = map(int, input().split())

if a > b + W:
    print(a - (b + w))
elif b > a + W:
    print(b - (a + W))
else:
    print(0)

Fixed submission:

W, a, b = map(int, input().split())

if a > b + W:
    print(a - (b + W))
elif b > a + W:
    print(b - (a + W))
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    if x > S:
        break
    y = 0
    while (y <= K):
        if y > S:
            break
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

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

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    if x > S:
        break
    y = 0
    while (y <= K):
        if y > S:
            break
        if S - (x + y) <= K and 0 <= S - (x + y):
            count += 1
        y += 1
    x += 1



print(count)

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

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if S - (x + y) <= K and 0 <= S - (x + y):
            count += 1
        y += 1
    x += 1



print(count)

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

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        z = S - (x + y)
        if z <= K and 0 <= z:
            #print(x, y, z)
            count += 1
        y += 1
    x += 1



print(count)

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

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        z = 0
        while (z <= K):
            if x + y + z == S:
                count += 1
            z += 1
        y += 1
    x += 1

print(count)

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

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
print(max([a+b, a-b, a*b]))

Fixed submission:
a, b = map(int, input().split())
print(max([a+b, a-b, a*b]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
ans = True
minv = 0

for i in range(len(h)-1):
    down = False
    
    if h[i] > h[i+1]:
        if h[i] - h[i+1] > 1:
            ans = False
            break
        else:
            if h[i]-1 >= minv:
                h[i] -= 1
                minv = h[i]
                down = True
            else:
                ans = False
                break
    if not down and  i!=0 and h[i-1] < h[i]:
        h[i] -= 1
        minv = h[i]


print("Yes") if ans else print("No")

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
ans = True
minv = 0

for i in range(len(h)-1):
    down = False
    
    if h[i] > h[i+1]:
        if h[i] - h[i+1] > 1:
            ans = False
            break
        else:
            if h[i]-1 >= minv:
                h[i] -= 1
                minv = h[i]
                down = True
            else:
                ans = False
                break
    if not down and  i!=0 and h[i-1] < h[i]:
        h[i] -= 1
        minv = h[i]


print("Yes") if ans else print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
cr, cl = 1, 0
ans = [0]*n
isRL = False
bp = 0

for i in range(1, n):
    cr += 1 if s[i] == "R" else 0
    cl += 1 if s[i] == "L" else 0
    if  isRL:
        if s[i] == "R" or i == n-1:
            cr -= 1 if i != n-1 else 0
            ans[bp-1] = math.ceil(cr/2) + int(cl/2)
            ans[bp] = int(cr/2) + math.ceil(cl/2)
            cr, cl, isRL = 1, 0, False
    else:
        if s[i-1] == "R" and s[i] == "L":
            bp = i
            isRL = True
            if i == n-1:
                ans[bp-1] = math.ceil(cr/2) + int(cl/2)
                ans[bp] = int(cr/2) + math.ceil(cl/2)
            
for a in ans:
    print(a, end=" ")


Fixed submission:
import math
s = input()
n = len(s)
cr, cl = 1, 0
ans = [0]*n
isRL = False
bp = 0

for i in range(1, n):
    cr += 1 if s[i] == "R" else 0
    cl += 1 if s[i] == "L" else 0
    if  isRL:
        if s[i] == "R" or i == n-1:
            cr -= 1 if i != n-1 else 0
            ans[bp-1] = math.ceil(cr/2) + int(cl/2)
            ans[bp] = int(cr/2) + math.ceil(cl/2)
            cr, cl, isRL = 1, 0, False
    else:
        if s[i-1] == "R" and s[i] == "L":
            bp = i
            isRL = True
            if i == n-1:
                ans[bp-1] = math.ceil(cr/2) + int(cl/2)
                ans[bp] = int(cr/2) + math.ceil(cl/2)
            
for a in ans:
    print(a, end=" ")

Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s)
cr, cl = 1, 0
ans = [0]*len(s)
isRL = False

for i in range(1, n):
    cr += 1 if s[i] == "R" else 0
    cl += 1 if s[i] == "L" else 0
    if  isRL:
        if s[i] == "R" or i == n-1:
            cr -= 1 if i != n-1 else 0
            ans[bp-1] = math.ceil(cr/2) + int(cl/2)
            ans[bp] = int(cr/2) + math.ceil(cl/2)
            cr, cl, isRL = 1, 0, False
    else:
        if s[i-1] == "R" and s[i] == "L":
            bp = i
            isRL = True
            if i == n-1:
                ans[bp-1] = math.ceil(cr/2) + int(cl/2)
                ans[bp] = int(cr/2) + math.ceil(cl/2)
            
for i in ans:
    print(i, end=" ")

Fixed submission:
import math
s = input()
n = len(s)
cr, cl = 1, 0
ans = [0]*n
isRL = False
bp = 0

for i in range(1, n):
    cr += 1 if s[i] == "R" else 0
    cl += 1 if s[i] == "L" else 0
    if  isRL:
        if s[i] == "R" or i == n-1:
            cr -= 1 if i != n-1 else 0
            ans[bp-1] = math.ceil(cr/2) + int(cl/2)
            ans[bp] = int(cr/2) + math.ceil(cl/2)
            cr, cl, isRL = 1, 0, False
    else:
        if s[i-1] == "R" and s[i] == "L":
            bp = i
            isRL = True
            if i == n-1:
                ans[bp-1] = math.ceil(cr/2) + int(cl/2)
                ans[bp] = int(cr/2) + math.ceil(cl/2)
            
for a in ans:
    print(a, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
    k = a[i]
    a[i] = 0
    print(max(a))
    a[i] = k
    

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
b = sorted(a)
for i in range(n):
    if a[i] == b[-1]:
        print(b[-2])
    else:
        print(b[-1])
Buggy python submission (verdict: Runtime Error):
list = input().split()
list = sort(list)
print(list[0] + list[1])

Fixed submission:
list = input().split()
list.sort()
print(int(list[0]) + int(list[1]))
Buggy python submission (verdict: Runtime Error):
import itertools as it  
n=input()
n=int(n)
if n>=1 and n<=9:
	li=[i for i in range(1,n+1)]
	li=li*3
	print(len(set(itertools.combinations(li,3))))
else:
  pass

Fixed submission:
import itertools
n=input()
n=int(n)
if n>=1 and n<=9:
	li=[i for i in range(1,n+1)]
	li=li*3
	print(len(set(itertools.combinations(li,3))))
else:
  pass

Buggy python submission (verdict: Runtime Error):
import itertools as it  
n=int(input())
li=[i for i in range(1,n+1)]
li=li*3
print(len(set(itertools.combinations(li,3))))


Fixed submission:
import itertools
n=input()
n=int(n)
if n>=1 and n<=9:
	li=[i for i in range(1,n+1)]
	li=li*3
	print(len(set(itertools.combinations(li,3))))
else:
  pass
Buggy python submission (verdict: Runtime Error):
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if val:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

Fixed submission:
n=input().strip()
n=int(n)
if n>=2 and n<=50:
    num=list(map(int,input().strip().split()))
num.sort()

if n==2:
    print(sum(num)/2)
else:
    num.append((num[0]+num[1])/2)
    num=num[2:]
    for i in range(len(num)-1):
        num.append((num[-1]+num[0])/2)
        num=num[1:]
    print(num[-1])

Buggy python submission (verdict: Runtime Error):
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if len(val)>0:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

Fixed submission:
n=input().strip()
n=int(n)
if n>=2 and n<=50:
    num=list(map(int,input().strip().split()))
num.sort()

if n==2:
    print(sum(num)/2)
else:
    num.append((num[0]+num[1])/2)
    num=num[2:]
    for i in range(len(num)-1):
        num.append((num[-1]+num[0])/2)
        num=num[1:]
    print(num[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N**3

Fixed submission:
N = int(input())
print(N**3)
Buggy python submission (verdict: Runtime Error):
import pandas as pd

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

t = [abs(A - (T - i*0.006)) for i in H]
print(pd.Series(t).idxmin()+1)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

t = [abs(A - (T - i*0.006)) for i in H]
print(t.index(min(t))+1)

Buggy python submission (verdict: Runtime Error):
import pandas as pd

N = int(input())
T, A = map(int, input().split())
H= list(map(int, input().split()))

t = []
for i in H:
    t.append(abs(A - (T - i*0.006)))

print(pd.Series(t).idxmin()+1)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

t = [abs(A - (T - i*0.006)) for i in H]
print(t.index(min(t))+1)