Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math


def calc(A,B,C):
    a = np.linalg.norm(B - C)
    b = np.linalg.norm(C - A)
    c = np.linalg.norm(A - B)
    cosC = np.inner(A-C, B-C)/(b*a)
    if cosC <= 0:
        return 0
    tanC = math.sqrt(1/(cosC**2)-1)
    return (1 - 1/cosC + tanC) * (a+b-c)/4


a = np.array(ai())
b = np.array(ai())
c = np.array(ai())
print(max(calc(a,b,c),calc(b,c,a),calc(c,a,b)))

Fixed submission:
ai = lambda: list(map(int, input().split()))

import numpy as np
import math


def calc(A,B,C):
    a = np.linalg.norm(B - C)
    b = np.linalg.norm(C - A)
    c = np.linalg.norm(A - B)
    s = (a + b + c) / 2
    area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
    r = 2 * area / (a + b + c)
    m = max(a,b,c)
    return m/(2+m/r)


a = np.array(ai())
b = np.array(ai())
c = np.array(ai())
print(calc(a,b,c))
Buggy python submission (verdict: Runtime Error):
s = input()
stack = [s[0]]
for i in range(1,len(s)):
    cur_str = stack[-1]
    new_str = s[i]
    if cur_str+new_str=="ST":
        stack.pop()
    else:
        stack.append(new_str)
print(len(stack))


Fixed submission:
s = input()
stack = [s[0]]
for i in range(1,len(s)):
    if len(stack)==0:
        stack.append(s[i])
        continue
    else:
        cur_str = stack[-1]
        new_str = s[i]
        if cur_str+new_str=="ST":
            stack.pop()
        else:
            stack.append(new_str)
print(len(stack))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
while s.find('ST')!=-1:
    s = s.replace('SSTT','')
    s = s.replace('ST','')
print(len(s))


Fixed submission:
s = input()
stack = [s[0]]
for i in range(1,len(s)):
    if len(stack)==0:
        stack.append(s[i])
        continue
    else:
        cur_str = stack[-1]
        new_str = s[i]
        if cur_str+new_str=="ST":
            stack.pop()
        else:
            stack.append(new_str)
print(len(stack))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
while s.find('ST')!=-1:
    s = s.replace('ST','')
print(len(s))


Fixed submission:
s = input()
stack = [s[0]]
for i in range(1,len(s)):
    if len(stack)==0:
        stack.append(s[i])
        continue
    else:
        cur_str = stack[-1]
        new_str = s[i]
        if cur_str+new_str=="ST":
            stack.pop()
        else:
            stack.append(new_str)
print(len(stack))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
while s.find('ST')!=-1:
    s = s.replace('ST','',1)
print(len(s))


Fixed submission:
s = input()
stack = [s[0]]
for i in range(1,len(s)):
    if len(stack)==0:
        stack.append(s[i])
        continue
    else:
        cur_str = stack[-1]
        new_str = s[i]
        if cur_str+new_str=="ST":
            stack.pop()
        else:
            stack.append(new_str)
print(len(stack))
Buggy python submission (verdict: Time Limit Exceeded):
ai = lambda: list(map(int, input().split()))

n,x = ai()
a = ai()


def m(k):
    z = []
    for i in range(n):
        z.append(min(a[i-j] for j in range(k+1)))
    return sum(z)


print(min(m(k) + x*k for k in range(n)))


Fixed submission:
ai = lambda: list(map(int, input().split()))

n,x = ai()
a = ai()

ma = [[] for _ in range(n)]
for i in range(n):
    ma[i].append(a[i])
    for j in range(1,n):
        if ma[i][-1] > a[i-j]:
            ma[i].append(a[i-j])
        else:
            ma[i].append(ma[i][-1])


def m(k):
    return sum(ma[i][k] for i in range(n))


print(min(m(k) + x*k for k in range(n)))
Buggy python submission (verdict: Runtime Error):
ai = lambda: list(map(int,input().split()))

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)


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

while True:
    m = list(str(N))
    f = 0
    for i in d:
        if str(i) in m:
            f += 1
    if f == 0:
        print(N)
        break
    N += 1

Buggy python submission (verdict: Runtime Error):
ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)


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

while True:
    m = list(str(N))
    f = 0
    for i in d:
        if str(i) in m:
            f += 1
    if f == 0:
        print(N)
        break
    N += 1
Buggy python submission (verdict: Time Limit Exceeded):
ai = lambda: list(map(int,input().split()))

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2

ans %= mod
for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i)
    c2 = c2 * (bb - i + 1) * inv(a + bb - i)
    ans += c1 * c2
    ans %= mod
print(ans)


Fixed submission:
ai = lambda: list(map(int,input().split()))

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2


ans %= mod
for i in range(1, bb+1):
    ans += nCb(aa+b+i, b+i) * nCb(a+bb-1-i, bb-i)   
    ans %= mod

print(ans)


Fixed submission:
ai = lambda: list(map(int,input().split()))

mod = 10**9+7


def nCb(n, b):
    if b > n - b:
        b = n - b
    r = 1
    for k in range(n, n-b, -1):
        r = r * k % mod
    d = 1
    for k in range(1, b+1):
        d = d * k % mod
    return r * inv(d) % mod


def inv(x):
    return pow(x, mod - 2, mod)


h,w,a,b = ai()
aa = h-a-1
bb = w-b-1
c1 = nCb(aa+b, b)
c2 = nCb(a+bb-1, bb)
ans = c1 * c2
ans %= mod

for i in range(1, bb+1):
    c1 = c1 * (aa + b + i) * inv(b + i) % mod
    c2 = c2 * (bb - i + 1) * inv(a + bb - i) % mod
    ans += c1 * c2
    ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
arr = map(int,input().split(" "))
mx=arr(0)
mn=arr(0)
for a in srr:
  if(mx<a):
    mx=a
  else if(mn>a):
      mn=a

      print(mx-mn)

Fixed submission:
aa = input()
arr = list(map(int,input().split(" ")))
mx=arr[0]
mn=arr[0]
for aaa in arr:
  if(mx<aaa):
    mx=aaa
  elif(mn>aaa):
    mn=aaa

print(mx-mn)
Buggy python submission (verdict: Runtime Error):
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre) ):
        a = a[:len(a)-7]
	elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)


Fixed submission:
a = input()
if( a== "a" or a=="i" or a=="u" or a=="e" or a=="o" ):
    print("vowel")
else:
    print("consonant")
Buggy python submission (verdict: Runtime Error):
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre) ):
        a = a[:len(a)-7]
	elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)


Fixed submission:
dr ="dream" 
dre = "dreamer" 
er ="erase" 
ere = "eraser" 
a = input()
ret = "YES"
while len(a) != 0:
    if (a.endswith(dr) or a.endswith(er)):
        a = a[:len(a)-5]
    elif(a.endswith(dre)):
        a = a[:len(a)-7]
    elif(a.endswith(ere)):
        a = a[:len(a)-6]
    else:
        ret = "NO"
        break
        
print(ret)
Buggy python submission (verdict: Runtime Error):
n =input()
print((n+1) * n //2)

Fixed submission:
n =int(input())
print((n+1) * n //2)
Buggy python submission (verdict: Runtime Error):
l_si = input().split(" ")
l_si_i = [int(s) for s in l_si]

sm = sum(l_si_i)
av = round(sm /dv)
ret = 0

for it in l_si_i:
  ret = ret + (it -av) **2


print(ret)

Fixed submission:

dv = int(input())
l_si = input().split(" ")
l_si_i = [int(s) for s in l_si]

sm = sum(l_si_i)
av = round(sm /dv)
ret = 0

for it in l_si_i:
  ret = ret + (it -av) **2


print(ret)
Buggy python submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
b = set(a)
print(''.join(b ))

Fixed submission:
arr_str = input().split(" ")
ans = 0
for a in arr_str:
    if(a == "5"):
        ans = ans + 1
    elif(a=="7"):
        ans =ans +10

if( ans == 12):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))


Fixed submission:
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Buggy python submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
print(''.join(a ))

Fixed submission:
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))

Buggy python submission (verdict: Runtime Error):
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
b = set(a)
print(''.join(b ))

Fixed submission:
arr_len_int = int(input().split(' ')[0])
if (arr_len_int==1):
  print(input())
else:
  a = [input() for i in range(arr_len_int)]
  a.sort()
  print(''.join(a))
Buggy python submission (verdict: Runtime Error):
def odd_even():
    i = list(map(int, input().split()))
    if (i[0] * i[1]) % 2 == 0:
        print('Even')
    else:
        print('Odd')

if __name__=__main__:
    odd_even()

Fixed submission:
def odd_even():
    i = list(map(int, input().split()))
    if (i[0] * i[1]) % 2 == 0:
        print('Even')
    else:
        print('Odd')

if __name__=='__main__':
    odd_even()
Buggy python submission (verdict: Runtime Error):
import collections
from math import factorial
n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = factorial(num) / factorial(2) / factorial(num - 2)
        ans += int(b)
print(ans)

Fixed submission:
import collections
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = cmb(num, 2)
        ans += int(b)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    length = len(n)
    b = '9' * (length-1)
    c = int(n) - int(b)
    ans += c
    for i in range(length-2, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i-1)
            ans += (int(plus) - int(minus))
    print(ans)

Fixed submission:
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    if int(n) <= 9:
        print(int(n))
    else:
        length = len(n)
        b = '9' * (length-1)
        c = int(n) - int(b)
        ans += c
        for i in range(length-2, -1, -2):
            if i == 1:
                ans += 9
            else:
                plus = '9' * i
                minus = '9' * (i-1)
                ans += (int(plus) - int(minus))
        print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    length = len(n)
    ans += (int(n[1:])+1)
    for i in range(length-2, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i-1)
            ans += (int(plus) - int(minus))
    print(ans)

Fixed submission:
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    if int(n) <= 9:
        print(int(n))
    else:
        length = len(n)
        b = '9' * (length-1)
        c = int(n) - int(b)
        ans += c
        for i in range(length-2, -1, -2):
            if i == 1:
                ans += 9
            else:
                plus = '9' * i
                minus = '9' * (i-1)
                ans += (int(plus) - int(minus))
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num = []
for i in range(n):
    a = int(input())
    num.append(a)

max_n = max(num)

for i in range(n):
    b = num[i]
    if b == max_n:
        num_c = num
        c = num_c[i]
        num_c[i] = 0
        print(max(num_c))
        num_c[i] = c
    else:
        print(max_n)

Fixed submission:
n = int(input())
num = []
for i in range(n):
    a = int(input())
    num.append(a)

idx = num.index(max(num))
max_a = max(num)

num_c = num
num_c[idx] = 0
idx_2 = num_c.index(max(num_c))
max_a2 = max(num_c)

for i in range(n):
    if i == idx:
        print(max_a2)
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num = []
for i in range(n):
    a = int(input())
    num.append(a)

for i in range(n):
    b = num[i]
    num[i] = 0
    print(max(num))
    num[i] = b

Fixed submission:
n = int(input())
num = []
for i in range(n):
    a = int(input())
    num.append(a)

idx = num.index(max(num))
max_a = max(num)

num_c = num
num_c[idx] = 0
idx_2 = num_c.index(max(num_c))
max_a2 = max(num_c)

for i in range(n):
    if i == idx:
        print(max_a2)
    else:
        print(max_a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
d = sorted(d)
length = len(d) // 2
count = 0
for k in range(d[length - 1], d[length] + 1):
    min = sum(x<k for x in d)
    max = sum(x>=k for x in d)
    if min == max:
        count += 1
print(count)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d = sorted(d)
length = len(d) // 2
max = d[length]
min = d[length - 1]
print(max - min)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
count = 0
for k in range(1, 10**5):
    min = sum(x<k for x in d)
    max = sum(x>=k for x in d)
    if min == max:
        count += 1
print(count)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d = sorted(d)
length = len(d) // 2
max = d[length]
min = d[length - 1]
print(max - min)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int,input().split()))
count = 0
for k in range(1, 10**5):
    min = sum(x<k for x in d)
    max = sum(x>=k for x in d)
    if min == max:
        count += 1
print(count)

Fixed submission:
n = int(input())
d = list(map(int,input().split()))
d = sorted(d)
length = len(d) // 2
max = d[length]
min = d[length - 1]
print(max - min)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
count = 1
for i in range(1, n):
    if all(h[i] >= h[j] for j in range(0, i-1)):
        count += 1
if h[0] > h[1]:
    print(count-1)
else:
    print(count)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(1,n+1):
    exam = h[0:i]
    sorted_exam = sorted(exam)
    if exam[-1] == sorted_exam[-1]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
list = [input() for _ in range(6)]
for i in range(5):
  for j in range(i+1, 5):
    if list[j] - list[i] > list[5]:
      print(':(')
      sys.exit()
print('Yay!')

Fixed submission:
import sys
list = [int(input()) for _ in range(6)]
for i in range(5):
  for j in range(i+1, 5):
    if list[j] - list[i] > list[5]:
      print(':(')
      sys.exit()
print('Yay!')
Buggy python submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
zero_count = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
  elif amari == 0:
    zero_count += 1
if zero_count == 5:
  num_min = 0
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Fixed submission:
list = [int(input()) for i in range(5)]
ans = 0
amari = []
for i in range(5):
  ans += (list[i] // 10) * 10
  amari.append(list[i] % 10)
amari = sorted(amari)
for i in range(5):
  if amari[i] != 0:
    ans += amari[i]
    ans += (5-(i+1)) * 10
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0 and amari < min:
    min = amari
    num_min = i
for i in range(5):
  if i != num_min:
    if list[i] % 10 == 0:
      ans += list[i]
    else:
      ans += (list[i] // 10 + 1) * 10
  elif i == num_min:
    ans += list[i]
print(ans)

Fixed submission:
list = [int(input()) for i in range(5)]
ans = 0
amari = []
for i in range(5):
  ans += (list[i] // 10) * 10
  amari.append(list[i] % 10)
amari = sorted(amari)
for i in range(5):
  if amari[i] != 0:
    ans += amari[i]
    ans += (5-(i+1)) * 10
    break
print(ans)

Buggy python submission (verdict: Runtime Error):
list = [int(input()) for i in range(5)]
min = 9
ans = 0
for i in range(5):
  amari = list[i] % 10
  if amari != 0:
    if amari < min:
      min = amari
      num_min = i
for i in range(5):
  if i != num_min:
    ans += int(round(list[i], -1))
  else:
    ans += list[i]
print(ans)

Fixed submission:
list = [int(input()) for i in range(5)]
ans = 0
amari = []
for i in range(5):
  ans += (list[i] // 10) * 10
  amari.append(list[i] % 10)
amari = sorted(amari)
for i in range(5):
  if amari[i] != 0:
    ans += amari[i]
    ans += (5-(i+1)) * 10
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
cost = []
for i in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cost.append(c)
cost = sorted(cost)
print(cost[0])

Fixed submission:
n, t = map(int, input().split())
cost = []
time = []
for i in range(n):
    c, ti = map(int, input().split())
    if ti <= t:
        cost.append(c)
        time.append(ti)
cost = sorted(cost)
if time != []:
    print(cost[0])
else:
    print('TLE')
Buggy python submission (verdict: Runtime Error):
miss

Fixed submission:
h, w = map(int, input().split())
a = [input() for _ in range(h)]
row = [False] * h
col = [False] * w

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            row[i] = True
            col[j] = True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j], end='')
        print()
Buggy python submission (verdict: Runtime Error):
def ctoi(x):
  if x == 'A':
    x = 10
  elif x == 'B':
    x = 11
  elif x == 'C':
    x = 12
  elif x == 'D':
    x = 13
  elif x == 'E':
    x = 14
  else:
    x = 15
x, y = input().split()
x = ctoi(x)
y = ctoi(y)
if x > y:
  print('>')
elif x < y:
  print('<')
else:
  print('=')

Fixed submission:
x, y = input().split()
if x < y:
    print("<")
elif x > y:
    print(">")
else:
    print("=")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input())
if a == b:
  print(c)
elif a == c:
  print(b)
else:
  print(a)

Fixed submission:
a, b, c = map(int, input().split())
if a == b:
  print(c)
elif a == c:
  print(b)
else:
  print(a)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = [int(input()) for _ in range(n)]

num = a[0]
count = 0

if 2 not in a:
    print(-1)
else:
    while num != 2:
        b = num
        num = a[num - 1]
        count += 1
        if a[num - 1] == b:
            print(-1)
            sys.exit()
    print(count + 1)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

num = a[0]
count = 1

while num != 2 and count < n:
    count += 1
    num = a[num - 1]

if count < n:
    print(count)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
S = list(input())
A = S[0]
while A in S :
    S.remove(A)
B = S[0]
if len(S) == 2 :
    if B in S :
        print("Yes")
    else :
        print("No")
else :
    print("No")

Fixed submission:
S = list(input())
A = S[0]
while A in S :
    S.remove(A)
if len(S) == 2 :
    if S[0] == S[1] :
        print("Yes")
    else :
        print("No")
else :
    print("No")