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

Fixed submission:
S = input()
chars = []
for i in range(len(S)):
    chars.append(S[i])
if chars.count(chars[0]) == 2:
    for i in range(len(S)):
        if chars.count(chars[i]) != 2:
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
chars = []
for i in range(len(S)):
    chars.append(S[i])
if chars.count(chars[0]) == 2:
    for i in range(1, len(S) + 1):
        if chars[i] == 2:
            print("Yes")
else:
    print("No")
Problem p03042 (python)

Fixed submission:
a = input()
b = int(a[:2])
c = int(a[2:])
 
if b > 12 and c > 12:
  print("NA")
elif b > 12 or b == 0: # bがYY
  if c < 1:
    print("NA")
  else:
    print("YYMM")
elif c > 12 or c == 0: # cがYY
  if b < 1:
    print("NA")
  else:
    print("MMYY")
else:
  print("AMBIGUOUS")

Buggy submission (verdict: Runtime Error):
a = input()
b = int(a[:2])
c = int(a[2:])
 
if b > 12 and c > 12:
  print("NA")
elif b > 12 or b == 0: # bがYY
  if c < 1:
  	print("NA")
  else:
	print("YYMM")
elif c > 12 or c == 0: # cがYY
  if b < 1:
    print("NA")
  else:
    print("MMYY")
else:
  print("AMBIGUOUS")
Problem p03108 (python)

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

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

root = [0] * (n + 1)
count = [1] * (n + 1)

def uf(a):
    if root[a] == 0:
        return a
    else:
        return uf(root[a])

for i in range(m - 1, 0, -1):
    ha = uf(ab[i][0])
    hb = uf(ab[i][1])
    if ha == hb:
        ans[i - 1] = ans[i]
        continue
    ans[i - 1] = max(0, ans[i] - count[ha] * count[hb])
    if count[ha] > count[hb]:
        root[hb] = ha
        count[ha] += count[hb]
    else:
        root[ha] = hb
        count[hb] += count[ha]
for i in ans:
    print(i)

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

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

root = [0] * (n + 1)
count = [1] * (n + 1)

def uf(a):
    if root[a] == 0:
        return a
    else:
        return uf(root[a])

ab.reverse()
for i in range(len(ab)):
    ha = uf(ab[i][0])
    hb = uf(ab[i][1])
    if ha == hb:
        continue
    ans[m - i - 1] = max(0, ans[m - i] - count[ha] * count[hb])
    root[hb] = ha
    count[ha] += count[hb]
ans.pop(0)
for i in ans:
    print(i)
Problem p03209 (python)

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

num = 1
pate = 1
for i in range(n):
    num = num * 2 + 3
    pate = pate * 2 + 1

def culc(l, idx, num, pate):
    npate = (pate - 1) // 2
    nnum = (num - 3) // 2
    mid = (num + 1) // 2
    if l == 1:
        if idx == 0:
            return 0
        elif idx == 1:
            return 0
        elif idx == 2:
            return 1
        elif idx == 3:
            return 2
        elif idx == 4:
            return 3
        else:
            return 3
    elif mid == idx:
        return npate + 1
    elif mid < idx:
        return npate + 1 + culc(l - 1, idx - mid, nnum, npate)
    else:
        return culc(l - 1, idx - 1, nnum, npate)
print(culc(n, x, num, pate))

Buggy submission (verdict: Runtime Error):
(n, x) = list(map(int, input().split()))
num = 1
pate = 1
for i in range(n):
    num = num * 2 + 3
    pate = pate * 2 + 1
def culc(l, idx, num, pate):
    npate = (pate - 1) // 2
    nnum = (num - 3) // 2
    mid = (num + 1) // 2
    if idx == 1:
        return 0
    elif mid == idx:
        return npate + 1
    elif mid < idx:
        return npate + 1 + culc(l - 1, idx - mid, nnum, npate)
    else:
        return culc(l - 1, idx - 1, nnum, npate)
print(culc(n, x, num, pate))
Problem p03775 (python)

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

if n == 1:
    print(1)
    sys.exit()

yakusu = []

sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
    if n % i == 0:
        yakusu.append(i)
        yakusu.append(n // i)

yakusu.sort()
for i in range(len(yakusu) // 2 + 1):
    if len(yakusu) - i * 2 <= 1:
        if len(yakusu) - i * 2 == 0:
            ans = yakusu[len(yakusu) - i]
        else:
            ans = yakusu[i]
        for j in range(1, 11):
            if ans // 10 == 0:
                print(j)
                break
            ans //= 10
        sys.exit(0)

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

insu = {}

sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
    if n % i == 0:
        insu[i] = 1
        insu[n // i] = 1

dct = sorted(insu.items())

for i in range(len(dct) // 2 + 1):
    if len(dct) - i * 2 <= 1:
        ans1 = dct[i][0]
        ans2 = dct[len(dct) - i][0]
        for i in range(1, 10):
            if ans2 // 10 == 0:
                print(i)
                break
            ans2 //= 10
        sys.exit(0)
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split())
x=[0]*n
for i in range(k):
    y=int(input())
    z=list(map(int,input().split()))
    for j in z:
        x[j-1] +=1
a=0
for b in x:
    if b==0:
        a+=1
print(a)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
x=[0]*n
for i in range(k):
    y=int(input())
    z=list(map(int,input().split()))
    for j in z:
        x[j-1] +=1
a=0
for b in x:
    if b==0:
        c+=1
print(c)
Problem p02707 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
x=[0]*N
for i in A:
    x[i-1]+=1
for j in x:
    print(j)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
x=A[0]*N
for i in A:
    x[i-1]+=1
for j in x:
    print(j)
Problem p02754 (python)

Fixed submission:
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
    print(x*A+y)
else:
    print(x*A+A)

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
x=N//(A+B)
y=N%(A+B)
if y<A:
    print(x*A+y)
else:
    print(x*a+a)
Problem p02836 (python)

Fixed submission:
S = input()
x =0
for i in range(len(S)//2):
	if S[i]!=S[-i-1]:x+=1
print(x)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <string>

using namespace std;

int main () {
   string S;
   cin>>S;
   int a=S.length(),x=0;
   for(int i=0;i<a;i++){
       if(S[i]!=S[a-i-1]);{
           x++;
       }
   }
   x=(x-(x%2))/2;
   cout<<x;
   return 0;   }
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
if a==3:
  print(3-b)
elif b==3:
  print(3-a)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
if a==3:
  print(3-b)
elif b==3:
  print(3-a)
else:
  print(a+b)
Problem p02915 (python)

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

Buggy submission (verdict: Runtime Error):
e=int(input())
sum=1
for i in e:
  sum*=i**e
print(sum)
Problem p02933 (python)

Fixed submission:
print('red' if int(input())<3200 else input())

Buggy submission (verdict: Runtime Error):
print('red' if int(int(input())<3200 else input())
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
val= int(input())
return val^2

Buggy submission (verdict: Runtime Error):
import math

numofpoints= int(raw_input())
coords=[]
for index in range(numofpoints):
	x,y= map(int, raw_input.split())
    coords.append((x,y))
    
def factorial(n):
  	if n==0:
      return 1
    else:
		return n*factorial(n-1)

ave=0
c=0
for i in range(numofpoints):
  xi=coords[i][0]
  yi=coords[i][0]
	for j in range(i,numofpoints):
    	xj=coords[j][0]
  		yj=coords[j][0]
        	rij = ((xi-xj)**2 + (yi-yj)**2)**0.5
        ave = ave + rij
print sumofnum/math.factorial(numofpoints)

Buggy submission (verdict: Runtime Error):
numofpoints= int(raw_input())
coords=[]
for index in range(numofpoints):
	x,y= map(int, raw_input.split())
    coords.append((x,y))
    
def factorial(n):
  	if n==0:
      return 1
    else:
		return n*factorial(n-1)

sumofnum=0
c=0
for i in range(numofpoints):
	for j in range(numofpoints):
    	if i!=j:
        	sumofnum+=((coords[i][0]-coords[j][0])**2+(coords[j][1]-coords[j][1])**2)**5
			c+=1
print "%.10f"%(sumofnum/c)
Problem p02860 (python)

Fixed submission:
n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
ch=input()
if n%2==1:
    print('No')
else:
    if ch[:n//2]==ch[n//2:]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
numberinput= int(raw_input())
letterinput= raw_input()
if numberinput%2==1:
	print("No")
else:
  	if letterinput[:len(letterinput)//2]==letterinput[len(letterinput)//2:]
    	print("Yes")
    else:
        print("No)

Buggy submission (verdict: Runtime Error):

ch=input()

if ch[:n//2]==ch[n//2:]:
  print('Yes')
else:
   print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
word=input()

letters=[]
for letter in word:
    letters.append(letters)
letters1= letters[:len(letters)//2]
letters2= letters[len(letters)//2:]
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Buggy submission (verdict: Runtime Error):
for letter in listofentries[1]:
    letters.append(letters)
letters1= letters[:len(letters)//2]
letters2= letters[len(letters)//2:]
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Buggy submission (verdict: Runtime Error):

for letter in listofentries[1]:
    letters.append(letters)
numbertoindex= listofentries[0]/2-1
 
for index in range(numbertoindex):
	letters1.append(index)
for index in range(numberofindex, listofentries[0]-1)
	letters2.append(index)
  
if letters1==letters2:
	return print(Yes)
else:
  	return print(No)

Buggy submission (verdict: Runtime Error):
listofentries=input().split()
letters=[]
letters1=[]
letters2=[]
if listofentries[0]%2==1:
	return No
else:
	for letter in listofentries[1]:
    	letters.append(letters)
numbertoindex= listofentries[0]/2-1

for index in range(numbertoindex):
	letters1.append(index)
for index in range(numberofindex, listofentries[0]-1)
	letters2.append(index)
  
if letters1==letters2:
	return Yes
Problem p02933 (python)

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

if a >= 3200:
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
edges = [input().split() for _ in range(N-1)]
operations = [input().split() for _ in range(Q)]

tree = {}
counter = [0]*N
result = [0]*N
numbers = []

for o in operations:
    counter[int(o[0])-1] += int(o[1])

result[0] = counter[0]

# print(counter)

for e in edges:
    parent = e[0]
    sun = e[1]
    if sun in numbers:
        sun = e[0]
        parent = e[1]
    else:
        numbers.append(sun)

    if sun in tree:
        tree[sun].append(parent)
    else:
        tree[sun] = [parent]

    if parent in tree:
        tree[sun].extend(tree[parent])


# print(tree)

for k in tree.keys():
    result[int(k)-1] += counter[int(k) - 1]
    for i in tree[k]:
        result[int(k)-1] += counter[int(i)-1]

print(' '.join(map(str, result)))
Problem p02987 (python)

Fixed submission:
text = input()

text1 = text.replace(text[0], "")
try:
	text2 = text1.replace(text1[0], "")
except:
	text2 = "e"

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

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

if len(text) > 0:
	text1 = text.replace(text[0], "")
	text2 = text1.replace(text1[0], "")

	if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
	  print("Yes")
	else:
	  print("No")
else:
	print("No")

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

text1 = text.replace(text[0], "")
text2 = text1.replace(text1[0], "")

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

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

text1 = text.strip(text[0])
text2 = text1.strip(text1[0])

if len(text) == 4 and len(text1) == 2 and len(text2) == 0:
  print("Yes")
else:
  print("No")

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

if len(text) == 4:
	text = text.strip(text[0])
	if len(text) == 2:  
		text = text.strip(text[0])
		if len(text) == 0:
  			print("Yes")
		else:
  			print("No")
	else:
      print("No")
else:
 	print("No")

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

text = text.strip(text[0])
text = text.strip(text[0])

if len(text) == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
text = list(input())

list = {}

for t in text:
  if text.count(t) != 2:
    continue
  if t in list:
    list[t] += 1
  else:
    list[t] == 1
    
if len(list) == 2:
  return Yes
else:
  return No
Problem p02990 (python)

Fixed submission:
import math

N, K = input().split()
N = int(N)
K = int(K)
m = N - K
mod = 10**9+7

def factorial_m(N: int, M: int):
	res = 1
	for i in range(2, N+1):
		res *= i
		res %= M
	return res

def nCr(n, r, mod):
	if n == r:
		return 1
	elif r > n:
		return 0
	return (factorial_m(n, mod) * pow((factorial_m(n-r, mod) * factorial_m(r, mod)), mod-2, mod)) % mod

for i in range(1, K+1):
	print(nCr(N-K+1, i, mod) * nCr(K-1, i-1, mod) % mod)

Buggy submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)
m = n - k

for i in range(1, k+1):
	if m + 1 < i:
		red_order = 0
	else:
		red_order = int(math.factorial(m + 1) / (math.factorial(m + 1 - i) * math.factorial(i)))
	blue_order = int(math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1)))
	print(red_order*blue_order%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)

for i in range(1, k+1):
	red_order = int(math.factorial(n - k + 1) / (math.factorial(n - k + 1 - i) * math.factorial(i)))
	blue_order = int(math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1)))
	# print(red_order, blue_order)
	print(red_order*blue_order%1000000007)

Buggy submission (verdict: Runtime Error):
import math

n, k = input().split()
n = int(n)
k = int(k)

for i in range(1, k+1):
	red_order = math.factorial(n - k + 1) / (math.factorial(n - k + 1 - i) * math.factorial(i))
	blue_order = math.factorial(k - 1) / (math.factorial(k - 1 - (i - 1)) * math.factorial(i - 1))
	print(int(red_order*blue_order%1000000007))
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S, W = int(input().split())
if S < W:
    print('unsafe')
else:
    print('safe')
Problem p02831 (python)

Fixed submission:
from fractions import gcd
x, y = map(int, input().split())
print((x * y) // gcd(x, y))

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

Buggy submission (verdict: Runtime Error):
import math
x, y = map(int, input())
print((x * y) // math.gcd(x, y))
Problem p02833 (python)

Fixed submission:
n = int(input())
if n % 2 != 0:
  print(0)
else:
  ans = 0
  while n:
    n //= 5
    ans += n // 2
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 2 != 0:
  print(0)
else:
  while n:
    ans += n
  print(n)
Problem p02862 (python)

Fixed submission:
x, y = map(int, input().split())
mod = 1000000007
class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv
if (x + y) % 3 != 0:
  print(0)
else:
  n = (x + y) // 3
  if n > x or n > y:
    print(0)
  else:
    nx = x - n
    comb = Combination(n)
    print(comb(n, nx))

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
mod = 1000000007
class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv
if (x + y) % 3 != 0:
  print(0)
else:
  n = (x + y) // 3
  nx = x - n
  comb = Combination(n)
  print(comb(n, nx))
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
r = [0, 1]
mod = 1000000007
a = []
for i in range(m):
  a.append(int(input()))
j = 0
for i in range(n):
  if j < m and i == a[j] - 1:
    r = [r[1], 0]
    j += 1
  else:
    r = [r[1], (r[0] + r[1]) % mod]
print(r[-1])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
r = [1]
mod = 1000000007
a = [int(input())]

for i in range(n):
  if i == a[-1] - 1:
    if len(a) < m:
      a.append(int(input()))
    r.append(0)
  elif i == 0:
    r.append(1)
  else:
    r.append((r[i] + r[i-1]) % mod)
print(r[-1])
Problem p02682 (python)

Fixed submission:
S = list(map(int,input().split()))
A = S[0]
B = S[1]
C = S[2]
K = S[3]

if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
S = input().split()
A = S[0]
B = S[1]
C = S[2]
K = S[3]

if K <= A:
  print(K)
elif K-A <= B:
  print(K)
else:
  print(K-C)

Buggy submission (verdict: Runtime Error):
S = input().split(' ')
A = S[0]
B = S[1]
C = S[2]
K = S[3]

if K <= A:
  print(K)
elif K-A <= B:
  print(K)
else:
  print(K-C)
Problem p02831 (python)

Fixed submission:
a, b = input().split()
product = int(a) * int(b);
complete = product
tmp = product
for i in range(2, min(int(a), int(b)) + 1):
    tmp = product / i
    if tmp % int(b) == 0 and tmp % int(a) == 0:
        complete = tmp
print(int(complete))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
complete = a * b;
tmp = complete
for i in range(1, min(a, b) + 1):
    tmp /= i
    if tmp % b == 0 and tmp % a == 0:
        complete = tmp

print(complete)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int, input().split())
if A >= K:
	print(K)
	exit()
K -= A
if B >= K:
	print(A)
	exit()
K -= B
print(A - K)

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int, input().split())
if A >= K:
	print(K)
	return
K -= A
if B >= K:
	print(A)
	return
K -= B
print(A - K)
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split(' '))
a=[0 for i in range(n+1)]
for z in range(k):
  x=int(input())
  temp=map(int,input().split(' '))
  for i in temp:
    a[i]+=1
c=0
for i in range(1,n+1):
  if(a[i]==0):
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split(' '))
a=list(1 for i in range(n+1))
for z in range(k):
  x=int(input())
  temp=map(int,input.split(' '))
  for i in temp:
    a[i]+=1
    c=0
for i in range(1,n+1):
  if(a[i]==0):
    c++
print(c)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split(' '))
a=list(1 for i in range(n+1))
for z in range(k):
  x=int(input())
  temp=map(int,input.split(' '))
  for i in temp:
    a[i]+=1
c=0
for i in range(1,n+1):
  if(a[i]==0):
    c++
print(c)
Problem p02688 (python)

Fixed submission:
N,K=map(int,input().split())
l = []
for k in range(K):
    a = int(input())
    lis=list(map(int,input().split()))
    l.extend(lis)
c=0
for j in range(N):
    if not j+1 in l:
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
l = []
for k in range(K):
    a = int(input())
    for i in range(a):
        l.append(int(input()))
print(l)
for j in range(N):
    if not j+1 in l:
        print(j+1)

Buggy submission (verdict: Runtime Error):
N=input()
K=input()
l=[]
for k in range(K):
  a=input()
  for i in range(a):
    l.append(input())
  
for j in range(N):
  if j not in l:
    print(j)

Buggy submission (verdict: Runtime Error):
N=input()
K=input()
l=[]
for k in range(K):
  a=input()
  for i in range(a):
    l.append(input())
  
for j in range(N):
  if j != in l:
    print(j)
Problem p02835 (python)

Fixed submission:
lst = list(map(int,input().split()))
if sum(lst)>=22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
lst = list(map(lst = list(map(int,input().split()))
if sum(lst)>=22:
    print("bust")
else:
    print("win")int,input().split()))
Problem p02693 (python)

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

c = 0
for i in range(s,d+1):
  if i % n == 0:
  	c = c + 1
  else:
    c = c
    
if c != 0:
 	print("OK")
else:
  	print("NG")

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

c = 0
for i in range(s,d+1):
  if i % s == 0:
  	c = c + 1


if c != 0:
 	print("OK"
else:
  	print("NG")

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

c = 0
for i in range(s,d+1:
  if i % s == 0:
  	c = c + 1


if c != 0:
 	print("YES")
else:
  	print("NO")
Problem p02699 (python)

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

if a > b:
  print("safe")
else:
  print("unsafe")

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

l = []
for i in range(n):
  l.append(input())
  

L = []
for i in l:
  if i not in L:
    L.append(i)
 
print(len(L))
Problem p03317 (python)

Fixed submission:
import math

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

print(math.ceil((n-1)/(k-1)))

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

print(math.ceil((n-1)/(k-1)))
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int,input().split())
print(min(k,a,a*2+b-k))

Buggy submission (verdict: Runtime Error):
a,c,b,k=man(int,split())
print(min(k,a,2a+b-k))
Problem p02793 (python)

Fixed submission:
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
l=list(map(int,input().split()))
a=lcm_list(l)
ans_l = []
for i in l:
    ans_l.append(a//i)
print(int(sum(ans_l)%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
l=list(map(int,input().split()))
a=lcm_list(l)
ans_l = []
for i in l:
    ans_l.append(a/i)
print(int(sum(ans_l)%(10**9+7)))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
l=list(map(int,input().split()))
a=lcm_list(l)
ans_l = []
for i in l:
    ans_l.append(a/i)
print(int(sum(ans_l)%(10**9+7)))