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

Fixed submission:
N,u,v = map(int,input().split())
E = [[] for _ in range(N + 1)]
for i in range(N-1):
    a,b = map(int,input().split())
    E[a].append(b)
    E[b].append(a)
#print(E)
def bfs(start,N):
    d = [-1]*(N+1)
    d[start] = 0
    q = [start]
    while q:
        #print(d,q)
        v = q.pop()
        cnt = d[v]+1
        for i in E[v]:
            if(d[i] == -1):
                q.append(i)
                d[i] = cnt
    return d
taka = bfs(u,N)
aoki = bfs(v,N)
#print(taka,aoki)
fin = 0
for i in range(N+1):
    if(taka[i] < aoki[i]):
        fin = max(fin,aoki[i])
print(fin - 1)

Buggy submission (verdict: Runtime Error):
N,u,v = map(int,input().split())
E = [[] for _ in range(N + 1)]
for i in range(N-1):
    a,b = map(int,input().split())
    E[a].append(b)
    E[b].append(a)
#print(E)
def bfs(start,N):
    d = [-1]*(N+1)
    d[start] = 0
    q = [start]
    while q:
        #print(d,q)
        v = q.pop()
        cnt = d[v]+1
        for i in E[v]:
            if(d[i] == -1):
                q.append(i)
                d[i] = cnt
    return d
taka = bfs(u,N)
aoki = bfs(v,N)
#print(taka,aoki)
for i in range(N+1):
    if(taka[i] < aoki[i]):
        fin = max(fin,aoki[i])
print(fin - 1)

Buggy submission (verdict: Runtime Error):
from collections import deque
N,u,v = map(int,input().split())
E = [[] for _ in range(N + 1)]
for i in range(N-1):
    a,b = map(int,input().split())
    E[a].append(b)
    E[b].append(a)
print(E)
def bfs(start,N,AB):
    d = [-1]*(N+1)
    d[start] = 0
    q = [start]
    while q:
        print(d,q)
        v = q.pop()
        cnt = d[v]+1
        for i in E[v]:
            if(d[i] == -1):
                q.append(i)
                d[i] = cnt
    return d
taka = bfs(u,N,AB)#takahashi
aoki = bfs(v,N,AB)
print(taka,aoki)
fin = -1
for i in range(N+1):
    if(taka[i] < aoki[i]):
        fin = max(fin,aoki[i])
        ans = fin - (aoki[i]-taka[i]+1)//2
print(ans)
Problem p02879 (python)

Fixed submission:
A,B = map(int,input().split())
if(A >= 10 or B >= 10):
    print(-1)
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = map(int(input()))
if(A >= 10 or B >= 10):
    print(-1)
else:
    print(A*B)
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
steps = [1,1,2]
for i in range(3,N+1):
    steps.append(steps[i-1]+steps[i-2])
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    if(b<a):
        print(0)
        exit()
    else:
        ans = ans*steps[b-a]%mod
    a = b+2
ans = ans*steps[N-a]%mod
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(5000)
N,M = map(int,input().split())
def stair(N):
    if(N <0):
        return 0
    if(N == 0):
        return 1
    elif(N == 1):
        return 1
    elif(N == 2):
        return 2
    else:
        return stair(N-1)+stair(N-2)
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    ans = ans*stair(b-a)%mod
    a = b+2
ans = ans*stair(N-a)%mod
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
def stair(N):
    if(N <0):
        return 0
    if(N == 0):
        return 1
    elif(N == 1):
        return 1
    elif(N == 2):
        return 2
    else:
        return stair(N-1)+stair(N-2)
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    ans = ans*stair(b-a)%mod
    print(a,b,ans)
    a = b+2
ans = ans*stair(N-a)%mod
print(ans)
Problem p02688 (python)

Fixed submission:
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  l = list(map(int, input().split()))
  for ll in l:
      ans_li[ll-1] += 1
print(ans_li.count(0))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  for j in range(d):
    l = list(map(int, input().split()))
    for ll in l:
      ans_li[ll-1] += 1
print(ans_li.count(0))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  for j in range(d):
    l = list(map(int, input().split()))
    for ll in l:
      ans_li[ll] += 1
print(ans_li.count(0))
Problem p02693 (python)

Fixed submission:
k = int(input())
a, b = map(int, input().split())
 
ans = 'NG'
aa =  (a-1) // k
bb =  b // k
if(bb - aa) > 0:
    print('OK')
else:
    print('NG')

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

ans = 'NG'
if a % k == 0:
  ans = 'OK'
elif b % k == 0:
  ans = 'OK'
elif (b-a) / k > 0:
  ans = 'OK'
print(ans)
Problem p02933 (python)

Fixed submission:
if __name__ == '__main__':
	a = int(input())
	s = input()
	if a >= 3200:
		print(s)
	else :
		print('red')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
	A,B,C = map(int, input().split())	
	if (A - B - C ) >= 0:
		print('0')
	else :
		print(C - (A-B))
Problem p02676 (python)

Fixed submission:
k = int(input())
s = input()

l = len(s)

if k >= l:
   print(s)
else:
  print(s[:k] + '...')

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

l = len(s)

if k >= l:
   print(k)
else:
  print(s[k - 1] + '...')
Problem p02725 (python)

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

max = 0

for i in range(n - 1):
  if a[i + 1] - a[i] > max:
    max = a[i + 1] - a[i]

if (k - a[n - 1]) + a[0] >= max:
  max = (k - a[n - 1]) + a[0]

print(k - max)

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

max = 0

for i in range(n - 1):
  if a[i + 1] - a[i] > max:
    max = a[i + 1] - a[i]

if (k - a[n]) + a[0] >= max:
  max = (k - a[n]) + a[0]

print(k - max)

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

max = 0

for i in range(n - 1):
  if a[i + 1] - a[i] > max:
    max = a[i + 1] - a[i]

if (k - a[n]) + a[0] >= max:
  max = (k - a[n]) + a[0]

print(k - max)
Problem p02819 (python)

Fixed submission:
x = int(input())

#def prime number discriminator

def prime_or_not(a):
  b = 0
  i = 2

  if a == 2:
    ans = True
    
  else:
    while i <= a - 1 and b < 1:
      if a % (i)== 0:
        b += 1
        i += 1
      else:
        i += 1
      
      if b >= 1:
        ans = False
      else:
        ans = True

    return ans

ans = 0

if x == 2:
  print(2)
else:
  while ans <1:
    ans += prime_or_not(x)
    x += 1
  print(x - 1)

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

#def prime number discriminator
def prime_or_not(a):
  b = 0
  for i in range(a):
    if a % i == 0:
      b += 1
    if b >= 1:
      return 0:
    else:
      return 1:

ans = 0

while ans =< 0:
  ans += primt_or_not(a)
  a += 1
print(a - 1)
Problem p02915 (python)

Fixed submission:
a = int(input())
b = a ** 3
print(int(b))

Buggy submission (verdict: Runtime Error):
a = input()
b = a ** 3
print(int(b))

Buggy submission (verdict: Runtime Error):
a = input()
print(a**3)
Problem p02916 (python)

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

m = 0

for i in range(n):
  num = int(a[i])
  m += b[num - 1]
#  print(i, m)  #erase later
  if num != n and i != n - 1:
    if num + 1 == int(a[i + 1]):
      m += c[num - 1]
#      print('C point', m)  #erase later
print(m)

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

m = 0

for i in range(n):
  num = int(a[i])
  m += b[num - 1]
  
  if num != n and != n - 1:
    if int(a[i]) == int(a[i + 1]):
      m += c[num - 1]
    
print(m)
print(a[0])

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

m = 0

for i in range(n):
  num = int(a[i])
  m += b[num - 1]
  
  if num != n:
    if int(a[i]) == int(a[i + 1]):
      m += c[num - 1]
    
print(m)
print(a[0])

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

m = 0

for i in range(n):
  num = a[i]
  m += b[num]
  
  if a[i + 1] == num + 1:
    m += c[i]
    
print(m)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a < 3200:
  print('red')
else:
  print(s)

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

if a <= 3200:
  print('red')
elsd:
  print(s)

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

if a >= 3200:
  print('red')
elsd:
  print(s)
Problem p02970 (python)

Fixed submission:
import math
ns, ds = input().split()
n, d = int(ns), int(ds)

if n % (2 * d + 1) == 0:
  ans = n / (2 * d + 1)
else:
  ans = math.floor(n / (2 * d + 1)) + 1

print(int(ans))

Buggy submission (verdict: Runtime Error):
ns, ds = input().split()
n, d = int(ns), int(ds)

if n % (2 * d + 1) == 0:
  ans = n / (2 * d + 1)
else:
  ans = floor(n / (2 * d + 1)) + 1

print(ans)
Problem p02987 (python)

Fixed submission:
S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('Yes')
else:
  print('No')

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

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print(YES)
else:
  print(NO)
S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('YES')
else:
  print('NO')

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

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print(YES)
else:
  print(NO)
Problem p03041 (python)

Fixed submission:
n,k=map(int, input().split())
S=input()
s=S.lower()
print(S[:k-1]+s[k-1]+S[k:])

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

s = input()

s1 = s[:k - 1]
s3 = s[:k - 2]
s2 = s[k:]

if s[k - 1] =='A':
  s3.append('a')
  print(s3 + s2)
elif s[k - 1] == 'B':
  s3.append('b')
  print(s3 + s2)
elif s[k - 1] == 'C':
  print(s3 + s2)
Problem p03042 (python)

Fixed submission:
s = input()
x = 0

sf = s[:2]
sl = s[2:]

if (int(sf[0]) == 0 and int(sf[1]) != 0):
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 0:
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 1:
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 2:
    x += 1


if (int(sl[0]) == 0 and int(sl[1]) != 0):
    x += 2

if int(sl[0]) == 1 and int(sl[1]) == 0:
    x += 2
if int(sl[0]) == 1 and int(sl[1]) == 1:
    x += 2
if int(sl[0]) == 1 and int(sl[1]) == 2:
    x += 2

b = x

if b == 0:
  print('NA')
elif b == 3:
  print('AMBIGUOUS')
elif b == 1:
  print('MMYY')
elif b == 2:
  print('YYMM')

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

a = s[:2]
b = s[2:]

ans = 0

if a <= 12 and a >= 1:
    ans += 2

if b <= 12 and b >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

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

a = s[0:1]
b = s[2:3]

ans = 0

if a <= 12 and a >= 1:
    ans += 2

if b <= 12 and b >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

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

sf = s[:1]  #'sf' is the formar part of the S
sl = s[2:]  #'sl' is the latter part of the S

for i in range(1:9):
  if sf[0] == 0:
    if sf[1] == i:
      a += 1
    else:
  else:
for j in range(0:2):
  if sf[0] == 1:
      if sf[1] == j:
        a += 1
      else:
  else:

for i in range(1:9):
  if sl[0] == 0:
    if sl[1] == i:
      a += 1
    else:
  else:
for j in range(0:2):
  if sl[0] == 1:
      if sl[1] == j:
        a += 1
      else:
  else:
    
if a == 0:
  print('NA')
elif a == 2:
  print('AMBIGUOUS')
elif a == 2:
  print('YYMM')
Problem p03265 (python)

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

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real), int(p3.imag), int(p4.real), int(p4.imag))

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

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real9), int(p3.imag), int(p4.real), int(p4.imag))

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

p1 = (n[0] + n[1]j)
p2 = (n[2] + n[3]j)

p3 = (p1 - p2) * j + p2
p4 = p3 + (p1 - p2)

print(real(p3),img(p3),real(p4)img(p4))
Problem p02707 (python)

Fixed submission:
n = int(input().strip())
arr = [int(i) for i in input().strip().split()]
result = {i:0 for i in range(1, n + 1)}
for i, j in enumerate(arr, 2):
    result[j] += 1
    
for i in result.values():
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input().strip().split())
arr = [int(i) for i in input().strip().split()]
result = {i:0 for i in range(1, n + 1)}
for i, j in enumerate(arr, 2):
    result[j] += 1
    
for i in result.values():
    print(i)
Problem p02725 (python)

Fixed submission:
k, n = [int(i) for i in input().strip().split()]
arr = [int(i) for i in input().strip().split()]
arr += [k + arr[0]]
max_d = 0
for i in range(1, n + 1):
    max_d = max(max_d, abs(arr[i] - arr[i - 1]))
print(k - max_d)

Buggy submission (verdict: Runtime Error):
k, n = [int(i) for i in input().strip().split()]
arr = [int(i) for i in input().strip().split()] + [k + arr[0]]
max_d = 0
for i in range(1, n + 1):
    max_d = max(max_d, abs(arr[i] - arr[i - 1]))
print(k - max_d)
Problem p02699 (python)

Fixed submission:
s,w = map(int,input().split())
 
if s <= w:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w = int(input())

if s <= w:
  print("unsafe")
else:
  print("safe")
Problem p02759 (python)

Fixed submission:
print(-1*(-1*int(input()) // 2))

Buggy submission (verdict: Runtime Error):
print(^(-1*int(input()) // 2))
Problem p02891 (python)

Fixed submission:
S = input()
K = int(input())
li = []
num = 1

#数えるセクション
for i in range(len(S)-1): #もしlen(S)==1の場合、ループは一回も回らない。（エラーもでない？）
    if S[i] == S[i+1]:
        num += 1
    else:
        li.append(num)
        num = 1
li.append(num)
#print(li)

#合計セクション
g = 0
for l in li:
    g += (l // 2)
#print(g)

#解答セクション
tmp = 0
result = 0
if len(li) == 1:
    result = (li[0] * K) // 2
else:
    tmp = sum(j // 2 for j in li)
    if S[0] != S[-1]:
        result = tmp * K
    else:
        if li[0] % 2 == li[-1] % 2 == 1: #最初と最後がどちらも奇数個の連続ならば、プラス1する必要がある。
            result = tmp * K + (1 * (K-1))
        else:
            result = tmp * K

print(result)

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

count = 0
S = S + "0"

i = 0
while i < len(S)-2:
    if S[i] == S[i+1]:
        count += 1
        i += 2
        """
        if S[i] == S[i+2]:
            i += 2
        else:
            i += 2
        """
    else:
        i += 1

S = S[:-1] #最後の0を削除

if len(S) == 1:
    result = K
elif len(S) == 2:
    result = count * K
else: #S[0]からの連続文字列数とS[-1]からの連続文字列数がどちらも奇数ならば「+ 1 × (K-1)」が必要
    if S[0] == S[-1]:
        len_first = 1
        i = 0
        while S[i] == S[i+1]:
            len_first += 1
            i += 1
        
        len_last = 1
        i = -1
        while S[i] == S[i-1]:
            len_last += 1
            i -= 1
        
        if len_first % 2 == 1 and len_last % 2 == 1:
            result = count * K + (K-1)
        else:
            result = count * K

              
        """
        if S[0] != S[1] and S[-1] != S[-2]:
            result = count * K + (K-1)
            #print("if1")
        elif S[0] == S[1] == S[2] and S[-1] != S[-2]: 
            result = count * K + (K-1)
            #print("if2")
        elif S[-1] == S[-2] == S[-3] and S[0] != S[1]: 
            result = count * K + (K-1)
            #print("if3")    
        else:
            result = count * K
            #print("else1")
        """

    else:
        result = count * K
        #print("else2")


print(result)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
 
if a >= 3200:
  print(s)
else:
  print("red")

Buggy submission (verdict: Runtime Error):
count = int(input())
numlist = list(map(int, sorted(input().split())))
result = 0

"""
for i in range(count-1):
  result = (numlist[i+1] + numlist[i]) / 2
"""

  #resultの結果をもう一回listに戻してsortする必要があるかも
  
while len(numlist) >= 2:
  sum = (numlist[1] + numlist[0]) / 2
  del numlist[0:2] #0,1番目の要素を削除
  numlist.append(sum)
  numlist = sorted(numlist)
  #print(sum)
  #print(numlist)
  
print(sum)

Buggy submission (verdict: Runtime Error):
a = input("input number: ")

if a < 28000 or a >= 5000:
  return false
elif a >= 3200:
  return s
else:
  return "red"
Problem p03075 (python)

Fixed submission:
xs = [int(input()) for i in range(5)]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
xs = [int(input()) for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
xs = [for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("Yay!")
else:
	print(":(")

Buggy submission (verdict: Runtime Error):
xs = [for i in range[5]]
k = int(input())
if (xs[4] - xs[0] <= k):
	print("YES")
else:
	print("NO")
Problem p02819 (python)

Fixed submission:
import math
x = int(input())
def check(x):
    for i in range(2, int(math.sqrt(x) + 1)):
        if x % i == 0:
            return False
    return True

for i in range(x, 200000):
    if check(i) == True:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
from sympy import nextprime
from sympy import isprime
x = int(input())
if isprime(x):
    print(x)
else:
    print(nextprime(x))
Problem p02831 (python)

Fixed submission:
import fractions as fr
a, b = map(int, input().split())
res = int(a*b / fr.gcd(a, b))
print(res)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
res = int(a*b / math.gcd(a, b))
print(res)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.gcd(a, b))
Problem p02835 (python)

Fixed submission:
a1, a2, a3 = map(int, input().split())
if a1+a2+a3 <= 21:
    print("win")
else:
    print("bust")

Buggy submission (verdict: Runtime Error):
a1, a2, a3 = map(int, input(), split())
if a1+a2+a3 <= 21:
    print("win")
else:
    print("bust")
Problem p02897 (python)

Fixed submission:
a = int(input())
print(int((a+1) / 2) / a)

Buggy submission (verdict: Runtime Error):
a = int(input())
print(1 / round(a/2))
Problem p03804 (python)

Fixed submission:
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

flag = False

for i in range(n-m+1):
    for j in range(n-m+1):
        cnt = 0
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] == b[k][l]:
                    cnt += 1
        if cnt == m**2:
            flag = True
            break
    if flag:
        break
print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

flag = False

for i in range(n):
    for j in range(n-m+1):
        cnt = 0
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] == b[k][l]:
                    cnt += 1
        if cnt == m**2:
            flag = True
            break
    if flag:
        break
print("Yes" if flag else "No")
Problem p02688 (python)

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

for i in range(k) :
    n_i = int(input())
    a = list(map(int,input().split()))
    a = [i-1 for i in a]
    for j in range(n_i) :
        s[i][a[j]] = 1

ans = 0
for i in range(n) :
    check = 1
    for j in range(k) :
        if s[j][i] == 1 :
            check = 0
            break
    if check == 1 :
        ans += 1

print(ans)

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

for i in range(k) :
    index = int(input()) - 1
    a = list(map(int,input().split()))
    a = [i-1 for i in a]
    for c in a :
        s[index][c] = 1

ans = 0
for i in range(n) :
    check = 1
    for j in range(k) :
        if s[j][i] == 1 :
            check = 0
            break
    if check == 1 :
        ans += 1

print(ans)
Problem p02832 (python)

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

r = 0
index = 0
ans = 0
for i in range(n) :
  r += 1
  for j in range(n) :
    if index >= n :
      break
    if a[index] == r :
      index += 1
      break
    ans += 1
    index += 1
      
if ans == n :
  print(-1)
else :
  print(ans)

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

r = 0
index = -1
ans = 0
for i in range(n) :
  index += 1
  r += 1
  if index >= n :
    break
  for j in range(n) :
    if a[index] == r :
      break
    ans += 1
    index += 1
      
if ans == n :
  print(-1)
else :
  print(ans)
Problem p02835 (python)

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

if a+b+c >= 22 :
  print('bust')
else :
  print('win')

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

for i in range(n):
  a = int(input())
  ip.append(a)
  for j in range(a):
    x,y = map(int,input().split())
    ip.append([x,y])

max = 0    
for i in range(n) :
  max += 2**i

ans = 0
for i in range(0,max+1) :
  s = [2 for _ in range(n)]
  bit = i
  count = 0
  index = 0
  check = 0
  for j in range(n) :
    if bit%2 == 1 :
      if s[j] == 0 :
        check = 1
      s[j] = 1
    else :
      if s[j] == 1 :
        check = 1
      s[j] = 0
    bit = bit//2
    for k in range(ip[index]) :
      if s[j] == 1 :
        if ip[index+1+k][1] == 1 :
          if s[ip[index+1+k][0]-1] == 0 :
            check = 1
          s[ip[index+1+k][0]-1] = 1
        elif ip[index+1+k][1] == 0 :
          if s[ip[index+1+k][0]-1] == 1 :
            check = 1
          s[ip[index+1+k][0]-1] = 0
    index += ip[index] + 1
  if ans < s.count(1) and check ==0 :
    ans = s.count(1)

print(ans)
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
print(int(int(input()**2)))