Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print(input()[:3]+"8"+input()[5:])

Fixed submission:
a=input()
print(a[:3]+"8"+a[4:])
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,inpot().split())
print(min(n*a,b))

Fixed submission:
n,a,b = map(int,input().split())
pln1 = n * a
pln2 = b
print(min(pln1,pln2))
Buggy python submission (verdict: Runtime Error):
n = Input()
ht = false
for char in n:
       if char == ‘9’:
               ht = true
               break
 
if ht :
     print(“Yes”)
else : 
    print(“No”)

Fixed submission:
n = input()
if n.find("9") >= 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n = Input()
ht = false
for char in 'n':
       if char == ‘9’:
               ht = true

if ht :
     print(“Yes”)
else : 
    print(“No”)

Fixed submission:
n = input()
if n.find("9") >= 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print("YES" if ((b-a)==(c-d)) else "NO")

Fixed submission:
a,b,c=map(int,input().split())
print("YES" if ((b-a)==(c-b)) else "NO")
Buggy python submission (verdict: Runtime Error):
s = Input()
r1 = s[0:4]
r2 = s[6:12]
r3 = s[14:]
print("{} {} {}".format(r1, r2, r3))

Fixed submission:
a,b,c = map(str,input().split(","))
print(a + " " + b + " " + c)
Buggy python submission (verdict: Runtime Error):
s = list(set(map(int,input.split())))
print(len(s))


Fixed submission:
s = list(set(map(int,input().split())))
print(len(s))

Buggy python submission (verdict: Runtime Error):
s = set(map(int,input.split()))
print(len(s))

Fixed submission:
s = list(set(map(int,input().split())))
print(len(s))
Buggy python submission (verdict: Runtime Error):
from collections import deque
import numpy as np

H, W = map(int, input().split())
sh, sw = map(int, input().split())
sh -= 1
sw -= 1
gh, gw = list(map(int, input().split()))
gh -= 1
gw -= 1
lst = []
for _ in range(H):
    lst.append(list(str(input())))
    
dx, dy = [1, 0, -1, 0], [0, 1, 0, -1]
visited = [[0]*W for _ in range(H)]

def dfs(sh, sw):
    global visited
    global flg
    flg = 0
    stack = deque([[sh, sw]])
    visited[sh][sw] = 1
    c = 0
    while stack:
        sh, sw = stack.pop()
        if sh == gh and sw  == gw:
            flg = 1
            break
        for i in range(4):
            nx = sh + dx[i]
            ny = sw + dy[i]
            if 0 > nx or nx >= H or 0 > ny or ny >= W:
                continue
            else:
                if lst[nx][ny] == '#' or visited[nx][ny] == 1:
                    continue
                else:
                    visited[nx][ny] = 1
                    stack.append([nx, ny])

c = lst.count('.')
ans = 0

dfs(sh, sw)

if visited[gh][gw]:
    print(ans)
ov = -1
nv = - 2
while ov != nv:
    ov = sum(visited[gh][gw], []).count(1)
    for h in range(H):
        for w in range (W):
            if visited[h][w] == 0 and lst[h][w] != '#':
                arr = np.array(visited)[max(0, h-2):min(H, h+3),max(0, w-2):min(W, w+3)].tolist()
                if sum(arr, []).count(1) >= 1:
                    ans += 1
                    dfs(h,w)
                    nv = sum(visited[gh][gw], []).count(1)
                    if flg:
                        break
                
if visited[gh][gw]:
    print(ans)
else:
    print(-1)

Fixed submission:
import math
a, b, c = map(int, input().split())
n = math.ceil(a / b)
print(c * n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for _ in range(1, n+1):
    y = n // _
    ans += y * (y + 1) / 2 * _  
    print(int(ans))

Fixed submission:
n = int(input())
ans = 0
for _ in range(1, n+1):
    y = n // _
    ans += y * (y + 1) / 2 * _  
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())

x = n 
nums = []
ans = ''
for i in range(1, 11):
    if 26**i >= n:
        for _ in range(i):
            print(x, x%26)
            x -= 1
            l = x % 26
            x //=  26
            nums.append(l)
        break
    else:
        n -= 26**i
        
for _ in nums:
    ans +=(chr(ord('a') + _))
    
print(ans[::-1]) 

Fixed submission:
n = str(input())
if n.islower():
    print('a')
else:
    print('A')
Buggy python submission (verdict: Runtime Error):
x = n 
nums = []
ans = ''
for i in range(1, 12):
    if 26**i >= n:
        for _ in range(i):
            print(x, x%26)
            x -= 1
            l = x % 26
            x //=  26
            nums.append(l)
        break
    else:
        n -= 26**i
        
for _ in nums:
    ans +=(chr(ord('a') + _))
    
print(ans[::-1]) 

Fixed submission:
n = int(input())

x = n 
nums = []
ans = ''
for i in range(1, 12):
    if 26**i >= n:
        for _ in range(i):
            x -= 1
            l = x % 26
            x //=  26
            nums.append(l)
        break
    else:
        n -= 26**i
        
for _ in nums:
    ans +=(chr(ord('a') + _))
    
print(ans[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int, input().split()))

lst.sort()

visited = [0 for _ in range(n)]
ans = n
for i in range(n):
  if visited[i] == 0:
    for j in range(i+1,n):
      if lst[j] % lst[i] == 0 and visited[j] == 0:
        ans -= 1
        visited[j] = 1
        if lst[j] == lst[i] and visited[i] == 0:
          ans -= 1
          visited[i] = 1
             
print(ans)

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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int, input().split()))

lst.sort()

visited = [0 for _ in range(n)]
ans = n
for i in range(n):
  if visited[i] == 0:
    for j in range(i+1,n):
      if lst[j] % lst[i] == 0:
        if visited[j] == 0:
          ans -= 1
          visited[j] = 1
          if lst[j] == lst[i] and visited[i] == 0:
            ans -= 1
            visited[i] = 1
             
print(ans)


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


maxA = max(a)
dp = [0]*(maxA+1)
count = 0

for e in a:
    for i in range(e,maxA+1,e):
        dp[i] += 1

for e in a:
    if dp[e] == 1:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
lst = list(map(int, input().split()))
for i in range(min(k,41)):
    lit = [0 for _ in range(n)]
    for _ in range(0, n):
        mx = max(0,_ - lst[_])
        mn = min(n, _ + lst[_] +1)
        lit[mx:mn] = map(lambda x:x+1, lit[mx:mn])
    lst = lit
lst = [str(_) for _ in lst]
ans = ' '.join(lst)
print(ans)


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

if n**(1/2) <= k:
    lst = [n for _ in range(n)]
    print(*lst)
else:
    for _ in range(k):
        ans = 0
        dp = [0] * (n + 1)
        for _ in range(n):  
            mx = max(0,_ - lst[_])
            mn = min(n, _ + lst[_] +1)
            dp[mx] += 1
            dp[mn] -= 1
        
        for _ in range(n):
            ans = ans + dp[_]
            lst[_] = ans

    print(*lst[:n])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
lst = list(map(int, input().split()))
for i in range(k):
    lit = [0 for _ in range(n)]
    for _ in range(0, n):
        mx = max(0,_ - lst[_])
        mn = min(n, _ + lst[_] +1)
        lit[mx:mn] = map(lambda x:x+1, lit[mx:mn])
    lst = lit
    if set(lst) == {n}:
        break
lst = [str(_) for _ in lst]
ans = ' '.join(lst)
print(ans)

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

if n**(1/2) <= k:
    lst = [n for _ in range(n)]
    print(*lst)
else:
    for _ in range(k):
        ans = 0
        dp = [0] * (n + 1)
        for _ in range(n):  
            mx = max(0,_ - lst[_])
            mn = min(n, _ + lst[_] +1)
            dp[mx] += 1
            dp[mn] -= 1
        
        for _ in range(n):
            ans = ans + dp[_]
            lst[_] = ans

    print(*lst[:n])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
lst = list(map(int, input().split()))
for _ in lst:
    ans *= _

if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
ans = 1
lst = list(map(int, input().split()))
flg = 0
if 0 in lst:
    print(0)
else:
    for _ in lst:
        ans *= _
        if ans > 10**18:
            print(-1)
            flg = 1
            break
    if not flg :
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
lst = list(map(int, input().split()))
for _ in lst:
    ans *= _

if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
ans = 1
lst = list(map(int, input().split()))
flg = 0
if 0 in lst:
    print(0)
else:
    for _ in lst:
        ans *= _
        if ans > 10**18:
            print(-1)
            flg = 1
            break
    if not flg :
        print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(str, input().split())
a = int(a)
b = float(b)

b = int(b * 100)
ans = a * b // 100

ans = int(math.floor(ans))
print(ans)

Fixed submission:
n = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
                
            arr.append(cnt)

    if temp != 1:
        arr.append(1)
        
    if arr==[] and n != 1:
        arr.append(1)

    return arr
  
lst = factorization(n)
ans = 0
if not lst:
  print(ans)
else:
  mx = max(lst)
  for _ in lst:
    for i in range(1, mx+1):
      if _ - i >= 0:
      	_ -= i
      	ans += 1
      else:
      	break
  print(ans)
Buggy python submission (verdict: Runtime Error):
md = m / 60 * 360

bx = math.sin(math.radians(md)) * b
by = math.cos(math.radians(md)) * b

hd = h / 12 * 360 + m / 60 * 30

ax = math.sin(math.radians(hd)) * a
ay = math.cos(math.radians(hd)) * a

ans = math.sqrt((ax - bx)**2 + (by - ay)**2)
print(ans)

Fixed submission:
import math
a, b, h, m = map(int, input().split())

md = m / 60 * 360

bx = math.sin(math.radians(md)) * b
by = math.cos(math.radians(md)) * b

hd = h / 12 * 360 + m / 60 * 30

ax = math.sin(math.radians(hd)) * a
ay = math.cos(math.radians(hd)) * a

ans = math.sqrt((ax - bx)**2 + (by - ay)**2)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
flg = 1
i = 0
now = 0
while flg:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break
        
k_bk = k - visited[now]
k_bk =  k_bk // (i - visited[now])

lft = k - k_bk * (i - visited[now])

if lft ==0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)

Fixed submission:
n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
i = 0
now = 0
while k > i:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break

lp = (i + 1) - visited[now]
st = i - lp
k_bk = k - st
k_bk = k_bk // lp
lft = k - (k_bk * lp + st)

if lft == 0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)

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

visited = [0] * n
flg = 1
i = 0
now = 0
while flg:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break
        
k_bk = k - visited[now]
k_bk =  k_bk // i

lft = (k - visited[now]) - i* k_bk

if lft ==0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)


Fixed submission:
n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
i = 0
now = 0
while k > i:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break

lp = (i + 1) - visited[now]
st = i - lp
k_bk = k - st
k_bk = k_bk // lp
lft = k - (k_bk * lp + st)

if lft == 0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)

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

visited = [0] * n
flg = 1
i = 0
now = 0
while flg:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break
print(i, now, visited)

k_bk = k - visited[now]
k_bk =  k_bk // i

lft = (k - visited[now]) - i* k_bk

if lft ==0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)

Fixed submission:
n, k = map(int, input().split())
lst = list(map(int, (input().split())))
lst = [_ - 1 for _ in lst]

visited = [0] * n
i = 0
now = 0
while k > i:
    if visited[now] == 0:
        i += 1
        visited[now] = i
        now = lst[now] 
    else:
        break

lp = (i + 1) - visited[now]
st = i - lp
k_bk = k - st
k_bk = k_bk // lp
lft = k - (k_bk * lp + st)

if lft == 0:
    print(now+1)
else:
    for _ in range(lft):
        now = lst[now]
    print(now+1)
Buggy python submission (verdict: Runtime Error):
import itertools

comb = list(itertools.product([_ for _ in range(-70, 140)],repeat=2))

for c in comb:
    a, b = c[0], c[1]
    if a**5 - b**5 == x:
        print(a, b)
        break

Fixed submission:
import itertools
x = int(input())

comb = list(itertools.product([_ for _ in range(-70, 140)],repeat=2))

for c in comb:
    a, b = c[0], c[1]
    if a**5 - b**5 == x:
        print(a, b)
        break
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n, x, y = map(int, input().split())

lst = [0 for _ in range(1, n)]
for _ in itertools.combinations([_ for _ in range(1, n+1)], 2):
    i, j = _[0], _[1] 
    ans = min(abs(i-j), abs(x-j)+1+abs(y-i),abs(x-i)+1+abs(y-j))
    lst[ans-1] += 1
    
for _ in lst:
    print(_)


Fixed submission:
import itertools
n, x, y = map(int, input().split())

lst = [0 for _ in range(1, n)]
for _ in itertools.combinations([_ for _ in range(1, n+1)], 2):
    i, j = _[0], _[1] 
    ans = min(abs(i-j), abs(x-j)+1+abs(y-i),abs(x-i)+1+abs(y-j))
    lst[ans-1] += 1
    
for _ in lst:
    print(_)
Buggy python submission (verdict: Runtime Error):
L = float(input())

ans = float((L/3)**3)

print(ans)

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

ans = n * (n - 1) // 2 + m * (m - 1) // 2

print(ans)
Buggy python submission (verdict: Runtime Error):
s = int(input())
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n +2)//2:n]
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = str(input())
n = len(s)
s1 = s[0:n//2]
s2 = s[(n+2)//2:n]
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
lst = [[] for _ in range(n)]
for _ in range(m):
    s, c = map(int, input().split())
    nums = append([s-1,c])

print(nums)

Fixed submission:
n = int(input())

if n % 2 == 1:
    ans = n//2 + 1
else:
    ans = n//2
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
lst = []
nums = []
for _ in range(3):
    l = []
    l = list(map(int, input().split()))
    lst.append(l)
    lst = np.array(lst)
n = int(input())
for _ in range(n):
    nums.append(int(input()))

for h in range(3):
    for w in range(3):
        if array[h][w] in nums:
            array[h][w] = 0

i = 0
for h in range(3):
    if sum(array[:, h]) == 0:
        i = 1
for w in range(3):
    if sum(array[w]) == 0:
        i = 1
if sum(np.diag(np.fliplr(array))) == 0:
    i = 1
if sum(np.diag(array)) == 0:
    i = 1

if i == 1:
    print("Yes")
else:
    print('No')

Fixed submission:
import numpy as np
lst = []
nums = []
for _ in range(3):
    l = []
    l = list(map(int, input().split()))
    lst.append(l)
    array = np.array(lst)
 
n = int(input())
for _ in range(n):
    nums.append(int(input()))

for h in range(3):
    for w in range(3):
        if array[h][w] in nums:
            array[h][w] = 0

i = 0
for h in range(3):
    if sum(array[:, h]) == 0:
        i = 1
for w in range(3):
    if sum(array[w]) == 0:
        i = 1
if sum(np.diag(np.fliplr(array))) == 0:
    i = 1
if sum(np.diag(array)) == 0:
    i = 1

if i == 1:
    print("Yes")
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = deque(map(int, input().split()))

lst2 = []
i = 0
while lst:
    now = lst.pop()
    lst2.append(now)
    if now == min(lst2):
        i += 1
print(i)

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

i = 0
mini = n +1
for _ in lst:
    if mini > _:
        mini = _
        i += 1
print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int, input().split()))

lst2 = [lst[_-1] == min(lst[0:_]) for _ in range(1,n+1)]
print(sum(lst2))

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

i = 0
mini = n +1
for _ in lst:
    if mini > _:
        mini = _
        i += 1
print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = list(map(int, input().split()))

lst2 = []
i = 0
for _ in range(n):
    now = lst[_] 
    lst2.append(now)
    
    if now == min(lst2):
        i += 1
print(i)

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

i = 0
mini = n +1
for _ in lst:
    if mini > _:
        mini = _
        i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

for _ in lst:
    idx = _[0] - 1
    if _[1] == 'WA' and jdg_ac[idx] != 1:
        jdg_wa[idx] += 1
    elif _[1] == 'AC':
        jdg_ac[idx] = 1
        penalty += jdg_wa[idx]
        
print(sum(jdg_ac),penalty)

Fixed submission:
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

penalty = 0
for _ in lst:
    idx = _[0] - 1
    if  jdg_ac[idx] != 1:
        if _[1] == 'WA':
            jdg_wa[idx] += 1
        elif _[1] == 'AC':
            jdg_ac[idx] = 1
            penalty +=  jdg_wa[idx]
print(sum(jdg_ac), penalty)

Buggy python submission (verdict: Runtime Error):
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

for _ in lst:
    if _[1] == 'WA' and jdg_ac[_[0]] == 0:
        jdg_wa[_[0]] += 1
    if _[1] == 'AC' and jdg_ac[_[0]] == 0:
        jdg_ac[_[0]] = 1

print(sum(jdg_ac),sum(jdg_wa))

Fixed submission:
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

penalty = 0
for _ in lst:
    idx = _[0] - 1
    if  jdg_ac[idx] != 1:
        if _[1] == 'WA':
            jdg_wa[idx] += 1
        elif _[1] == 'AC':
            jdg_ac[idx] = 1
            penalty +=  jdg_wa[idx]
print(sum(jdg_ac), penalty)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

def fact(n, x, ans):
    if x > n:
        return ans
    else:
        ans += math.floor(n/(2*x))
        return fact(n, x*5, ans)

if n < 2:
    print(1)
elif n%2:
    print(0)
else:
    print(fact5(n, 5, 0))

Fixed submission:
import math
n = int(input())

def fact(n, x, ans):
    if x > n:
        return ans
    else:
        ans +=  math.floor(n//(2*x))
        return fact(n, x*5, ans)

if n%2:
    print(0)
else:
    print(fact(n, 5, 0))

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

def fact(n, x, ans):
    if x > n:
        return ans
    else:
        ans += math.floor(n/(2*x))
        return fact(n, x*5, ans)

if n < 2:
    print(1)
elif n%2:
    print(0)
else:
    print(fact5(n, 5, 0))

Fixed submission:
import math
n = int(input())

def fact(n, x, ans):
    if x > n:
        return ans
    else:
        ans +=  math.floor(n//(2*x))
        return fact(n, x*5, ans)

if n%2:
    print(0)
else:
    print(fact(n, 5, 0))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y
        
ans = 0
for bit in range(2**n):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                  flg = False
                  break
    if flg:
        ans = max(ans, bin(bit).count('1'))
print(ans)


Fixed submission:
a, b, c = map(int, input().split())
if a+b+c >= 22:
    print('bust')
else:
    print('win')

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y
        
ans = 0
for bit in range(2**n):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                	flg = False
                    break
    if flg:
        ans = max(ans, bin(bit).count('1'))
print(ans)


Fixed submission:
a, b, c = map(int, input().split())
if a+b+c >= 22:
    print('bust')
else:
    print('win')

Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y

ans = 0
for bit in range(n**2 - 1):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                    flg = False
                    break
if flg:
  ans = max(ans, bin(bit).count('1'))
print(ans)
    

Fixed submission:
a, b, c = map(int, input().split())
if a+b+c >= 22:
    print('bust')
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y

ans = 0
for bit in range(n**2 - 1):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                    flg = False
                    break
if flg:
  ans = max(ans, bin(bit).count('1'))
print(ans)
    


Fixed submission:
n = int(input())
lst = []
for _ in range(n):
    a = int(input())
    lst.append([[int(i) for i in input().split()] for _ in range(a)])
m = 0
for i in range(2 ** n):
    a = True
    for j in range(n):
        if i >> j & 1:
            for x, y in lst[j]:
                if (i >> (x - 1) & 1) != y:
                    a = False
                    break
    if a:
        m = max(m, bin(i).count('1'))
print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(int(n * (n - 1) / 2))

Fixed submission:
s = list(input())
t = list(input())
p = []

for i in range(0,3):
    p.append(s[i] == t[i])
    
print(p.count(True))

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
print(int(int(n * (n - 1)) / 2))


Fixed submission:
s = list(input())
t = list(input())
p = []

for i in range(0,3):
    p.append(s[i] == t[i])
    
print(p.count(True))