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

Fixed submission:
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and a[1] != a[2]:
  print("Yes")
else:
  print("No")
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = map(int, input().split())
word = "NG"
for i in range(A, B+1):
    if i % K == 0:
        word = "OK"
print(word)

Buggy submission (verdict: Runtime Error):
K = int(input("multiple of: "))
A = int(input("From A: "))
B = int(input("To B: "))
word = "NG"
for i in range(A, B+1):
    if i % K == 0:
        word = "OK"
print(word)

Buggy submission (verdict: Runtime Error):
K = int(input("multiple of: "))
A = int(input("From A: "))
B = int(input("To B:"))
for i in range(1, 1000):
    M = K * i
    if M in range(A, B):
        print("OK")
        break
    elif i == 100 and M not in range(A, B):
        print("NG")
    else: 
        continue
Problem p02689 (python)

Fixed submission:
N,M = map(int,input().split())
H = [int(i) for i in input().split()]
nlst = [1 for i in range(N)]
for i in range(M):
    a,b =map(int,input().split())
    c = min(H[a-1],H[b-1])
    if c == H[a-1]:
        nlst[a-1] = 0
    if c == H[b-1]:
        nlst[b-1] = 0
print(sum(nlst))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = [int(i) for i in input().split()]
A = []
B = []
count = 0
for i in range(M):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
#ない場合
for i in range(1,N+1):
    if (not i in A) and (not i in B):
        count +=1
    
    for k in range(M):
        if i == A[k]:
            if H[i-1] >H[B[k]-1]:
                result = 1
            else:
                result = 0
                break
        if i ==B[k]:
            if H[i-1] >H[A[k]-1]:
                result = 1
            else:
                result = 0
                break
    if result == 1:
        count += 1
print(count)
Problem p02781 (python)

Fixed submission:
N = [int(i) for i in str(input())]
m = len(N)
K = int(input())
dp = [[[0 for i in range(K + 1)],[0 for i in range(K + 1)]]   for i in range(m)]
#初期条件
dp[0][1][0] = 1
dp[0][0][1] = 1
dp[0][1][1] = N[0] - 1
for i in range(1,m):
    for t in range(0,min(i+2,K+1)):
        if N[i] != 0:
            if t == 0:
                dp[i][1][t] = dp[i-1][1][t]
            else:
                dp[i][0][t] = dp[i-1][0][t-1]
                dp[i][1][t] = dp[i-1][0][t] + dp[i-1][0][t-1] * (N[i]-1) + dp[i-1][1][t] + dp[i-1][1][t-1] * 9
        else :
            if t == 0:
                dp[i][0][t] = dp[i-1][0][t]
                dp[i][1][t] = dp[i-1][1][t] 
            else :
                dp[i][0][t] = dp[i-1][0][t]
                dp[i][1][t] = dp[i-1][1][t] + dp[i-1][1][t-1] * 9
print(dp[-1][0][K]+dp[-1][1][K])

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in str(input())]
m = len(N)
K = int(input())
dp = [[[0 for i in range(m + 1)],[0 for i in range(m + 1)]]   for i in range(m)]
#初期条件
dp[0][1][0] = 1
dp[0][0][1] = 1
dp[0][1][1] = N[0] - 1
for i in range(1,m):
    for t in range(0,min(i+2,K+1)):
        if N[i] != 0:
            if t == 0:
                dp[i][1][t] = dp[i-1][1][t]
            else:
                dp[i][0][t] = dp[i-1][0][t-1]
                dp[i][1][t] = dp[i-1][0][t] + dp[i-1][0][t-1] * (N[i]-1) + dp[i-1][1][t] + dp[i-1][1][t-1] * 9
        else :
            if t == 0:
                dp[i][0][t] = dp[i-1][0][t]
                dp[i][1][t] = dp[i-1][1][t] * 1
            else :
                dp[i][0][t] = dp[i-1][0][t] + dp[i-1][1][t] + dp[i-1][1][t-1] * 9
print(dp[-1][0][K]+dp[-1][1][K])

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in str(input())]
m = len(N)
K = int(input())
dp = [[[0 for i in range(m + 1)],[0 for i in range(m + 1)]]   for i in range(m)]
#初期条件
dp[0][1][0] = 1
dp[0][0][1] = 1
dp[0][1][1] = N[0] - 1
for i in range(1,m):
    for t in range(0,i+2):
        if N[i] != 0:
            if t == 0:
                dp[i][1][t] = dp[i-1][1][t]
            else:
                dp[i][0][t] = dp[i-1][0][t-1]
                dp[i][1][t] = dp[i-1][0][t] + dp[i-1][0][t-1] * (N[i]-1) + dp[i-1][1][t] + dp[i-1][1][t-1] * 9
        else :
            if t == 0:
                dp[i][0][t] = dp[i-1][0][t]
                dp[i][1][t] = dp[i-1][1][t] * 1
            else :
                dp[i][0][t] = dp[i-1][0][t] + dp[i-1][1][t] + dp[i-1][1][t-1] * 9
print(dp[-1][0][K]+dp[-1][1][K])
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int,input().split())
U = input()
if S == U:
  print(A - 1, B)
else:
  print(A, B - 1)

Buggy submission (verdict: Runtime Error):
S, T = input().split())
A, B = map(int,input().split())
U = input()
if S == U:
  print(A - 1, B)
else:
  print(A, B - 1)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
if a == 1 and b == 2 or a == 2 and b == 1:
  print("3")
elif a == 1 and b == 3 or a == 3 and b ==1:
  print("2")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
def gcd(a,b):
    x = max(a,b)
    y = min(a,b)
    while x // y != 0:
        z = x // y
        y = z
        return z
print(int(a * b / gcd(a,b)))
Problem p03036 (python)

Fixed submission:
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
print(x2001)
print(x2002)
print(x2003)
print(x2004)
print(x2005)
print(x2006)
print(x2007)
print(x2008)
print(x2009)
print(x2010)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
X = '''x2001
x2002
x2003
x2004
x2005
x2006
x2007
x2008
x2009
x2010'''
print(int(X))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 -D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004- D
x2006 = r * x2005- D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
X = [x2001,x2002,x2003,x2004,x2005,x2006,x2007.x2008,x2009,x2010]
print(X)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * X - D
x2002 = r * X2001 -D
x2003 = r * X2002 - D
x2004 = r * X2003 - D
x2005 = r * X2004- D
x2006 = r * X2005- D
x2007 = r * X2006 - D
x2008 = r * X2007 - D
x2009 = r * X2008 - D
x2010 = r * X2009 - D
X = [x2001,x2002,x2003,x2004,x2005,x2006,x2007.x2008,x2009,x2010]
print(X)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * X - D
x2002 = r * X2001 -D
x2003 = r * X2002 - D
x2004 = r * X2003 - D
x2005 = r * X2004- D
x2006 = r * X2005- D
x2007 = r * X2006 - D
x2008 = r * X2007 - D
x2009 = r * X2008 - D
x2010 = r * X2009 - D
X = [x2001,x2002,x2003,x2004,x2005,x2006,x2007.x2008,x2009,x2010]
print(split(X))
Problem p03072 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
h = a[0]
count = 0
for i in range(n):
    if h <= a[i]:
        h = a[i]
        count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
n=input()
a=list(map(int,input().split()))
h = a[0]
count = 0
for i in len(a):
    if h <= a[i]:
        count =+ 1
print(count)
Problem p02711 (python)

Fixed submission:
str = input()
print("Yes") if '7' in str else print("No")

Buggy submission (verdict: Runtime Error):
import re
seven = re.pattern("7")
print("Yes") if seven.match(input()) else "No"
Problem p02754 (python)

Fixed submission:
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  if extra >= a:
    result += a
  else:
    result += extra
print(result)

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  cycle = [1]*a +  [0]*b
  if extra != 0:
   result += sum(cycle[:extra]) 
print(result)

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  cycle = [1]*a +  [0]*b
  result += sum(cycle[:extra]) 
print(result)

Buggy submission (verdict: Runtime Error):
8 3 4

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  cycle = [1]*a +  [0]*b
  result += sum(cycle[:extra]) 
print(result)

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
result = 0
if a + b != 0:
  roop = n // (a +b)
  extra = n - roop*(a+b)
  result = a*roop
  cycle = [1]*a +  [0]*b
  if extra != 0:
    result += sum(cycle[:extra]) 
print(result)

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
roop = n // (a +b)
extra = n - roop*(a+b)
result = a*roop
cycle = [1]*a +  [0]*b
if extra != 0:
  result += sum(cycle[:extra]) 
print(result)

Buggy submission (verdict: Runtime Error):
n, a, b = list(map(int, input().split()))
roop = n // (a +b)
extra = n - roop*(a+b)
print(extra)
result = a*roop
cycle = [1]*a +  [0]*b
if extra != 0:
  result += sum(cycle[:extra]) 
print(result)
Problem p02699 (python)

Fixed submission:
a, b = map(int, input().split())
if a>b:
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())

if math.ceil(a/d) >= math.ceil(c/b):
    print("Yes")
else:
    print("No")
Problem p02699 (python)

Fixed submission:
import sys

lines = sys.stdin.readlines()

x = lines[0].split(' ')
S =int(x[0])
W =int(x[1])

if S > W:
    ans = 'safe'
else:
    ans = 'unsafe'

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()

S = str(input())

#10**nのmod計算
A = []
p =1
for i in range(len(S)):
  A.append(p)
  p = p*10%2019

#左からi文字以降の数字列のmod計算
X = []
a = 0
for i in range(len(S)):
  a = (a + int(S[len(S)-i-1])*A[i]) %2019
  X.append(a)
X.sort()
flag =1
n = 0

#modが同じになる組み合わせ、またはもともとmodが0になる数字列の個数の総和計算
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += flag*(flag-1)//2
    flag = 1
print(n)
Problem p02689 (python)

Fixed submission:
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],H[b])
    mh[b] = max(mh[b],H[a])

ans = 0
for i in range(N):
    if mh[i] < H[i]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
mh = np.zeros([N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    mh[a] = max(mh[a],h[b])
    mh[b] = max(mh[b],h[a])

ans = 0
for i in range(N):
    if mh[i] < h[i]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
root = np.zeros([N,N],dtype='int16')
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    root[a,b] = 1
    root[b,a] = 1

ans = 0
for i in range(N):
    count = 0
    for l in range(N):
        if root[i,l] == 1 and H[i] <= H[l]:
            count = 1
    if count == 0:
        ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N,M = [int(i) for i in input().split(" ")]
H = [int(i) for i in input().split(" ")]
root = np.zeros([N,N])
for i in range(M):
    a,b = [int(i)-1 for i in input().split(" ")]
    root[a,b] = 1
    root[b,a] = 1

ans = 0
for i in range(N):
    count = 0
    for l in range(N):
        if root[i,l] == 1 and H[i] <= H[l]:
            count = 1
    if count == 0:
        ans += 1
    
print(ans)
Problem p02693 (python)

Fixed submission:
#[str(i) for i in input().split(" ")]
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0:
    print("OK")
elif (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B=[int(i) for i in input().split(" ")]
if A%K == 0　or (A//K+1)*K <= B:
    print("OK")
else:
    print("NG")
Problem p02835 (python)

Fixed submission:
def blackjack(s):
    a, b, c = [int(_) for _ in s.split()]
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    blackjack(in_str)

Buggy submission (verdict: Runtime Error):
def blackjack(s):
    a, b, c = [_ for int(_) in in_str.split()]
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    blackjack(in_str)
Problem p02693 (python)

Fixed submission:
K  = int((input() .split())[0])
A, B = map(int, input().split())

if A%K == 0 or  K*(A//K + 1) <= B :
	print('OK')

else :
	print('NG')

Buggy submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

if A%K == 0 or B%K == 0
	print 'OK'

elif A <= K*(A//K + 1) and K*(A//K + 1) <= B :
	print 'OK'

else :
	print 'NG'

Buggy submission (verdict: Runtime Error):
K = int(input())
A, B = map(int, input().split())

If A%K == 0 or B%K == 0
	print 'OK'

elif A <= K*(A//K + 1) and K*(A//K + 1) <= B :
	print 'OK'

else :
	print 'NG'
Problem p02693 (python)

Fixed submission:
K = int(input())
AB = input()
ABB = AB.split()
A = int(ABB[0])
B = int(ABB[1])
C = 0

for i in range(A, B+1):
  if i % K ==0:
    print('OK')
    C = 1
    break
if C == 0:
  print('NG')

Buggy submission (verdict: Runtime Error):
if B//K - A//K >=1:
	print('OK')
elif B == A:
	print('OK')
else:
	print('NG')
Problem p02989 (python)

Fixed submission:
N=int(input())
d=list(map(int, input().split()))
C=N//2
d.sort()
if d[C]==d[C-1]:
    print(0)
else:
    print(d[C]-d[C-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
d=list(map(int, input().split()))
C=N//2
for x in range(0,N):
    for y in range(0,N-1):
        if d[y]<d[y+1]:
            t=d[y]
            d[y]=d[y+1]
            d[y+1]=t
    N=N-1
if d[C]==d[C-1]:
    print(0)
elif:
    print(d[C-1]-d[C])
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
d = []
A = []

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

okashi = [0] * N

for l in range(K):
    for i in A[l]:
        okashi[i-1] += 1

count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

okashi = [0] * N

for l in range(N):
    for i in A[l]:
        okashi[i-1] += 1

count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)
Problem p02688 (python)

Fixed submission:
n,k=map(int,input().split())
m=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    if i not in m:
      m.append(i)
mx=max(m)
c=0
for i in range(1,n+1):
  if(i not in m):
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
m=[]
for _ in range(2*k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    if i not in m:
      m.append(i)
mx=max(m)
c=0
for i in range(1,n+1):
  if(i not in m):
    c+=1
print(c)
Problem p02859 (python)

Fixed submission:
i=int(input())
print(i*i)

Buggy submission (verdict: Runtime Error):
i=int(intput())
print(i*i)
Problem p02689 (python)

Fixed submission:
import sys
N, M = map(int, sys.stdin.readline().rstrip().split())
h_i = [int(x) for x in sys.stdin.readline().rstrip().split()]
ab = [list(map(int, sys.stdin.readline().rstrip().split())) for _ in range(M)]
 
J = [1 for i in range(N)]
#print(ab,J)

for li in ab:
  #print(li)
  if h_i[li[0]-1] < h_i[li[1]-1]:
    J[li[0]-1] = 0
  elif h_i[li[0]-1] == h_i[li[1]-1]:
    J[li[0]-1] = J[li[1]-1] = 0
  else:
    J[li[1]-1] = 0
print(J.count(1))

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, sys.stdin.readline().rstrip().split())
h_i = [int(x) for x in sys.stdin.readline().rstrip().split()]
ab = [list(map(int, sys.stdin.readline().rstrip().split())) for _ in range(M)]

J = [1 for i in range(N)]
for li in ab:
  if h_i[li[0]] < h_i[li[1]]:
    J[li[0]] = 0
  elif h_i[li[0]] == h_i[li[1]]:
    J[li[0]] = J[li[1]] = 0
  else:
    J[li[1]] = 0
print(J)
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
print('safe' if S > W else 'unsafe')

Buggy submission (verdict: Runtime Error):
import sys
N = int(sys.stdin.readline())
list = []
for i in range(N):
  S = sys.stdin.readline()
  if S not in list:
    list.append(S)
print(len(list))
Problem p02711 (python)

Fixed submission:
N = eval(input())
a = str(N)
k=[]
for i in a:
    if i == "7":
        k.append(i)
if len(k) > 0:
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
N = 7
if N > = 100 and N <=999:
  print (Yes)
else:
  print (No)
Problem p02723 (python)

Fixed submission:
a = input()
if a[2] ==a[3] and a[4]==a[5]:
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
a = input()
if a[2] ==a[3]:
    print ("Yes")
else:
    print ("No")
Problem p02725 (python)

Fixed submission:
K, N = list(map(int, input().split()))
an = list(map(int,input().split()))

min_list = []
for i in range(N):
    if i == 0:
        left = an[i] + K - an[-1]
        right = an[i+1] - an[i]
    elif i == N-1:
        left = an[i] - an[i-1]
        right = an[0] + K - an[N-1]
    else:
        left = an[i] - an[i-1]
        right = an[i+1] - an[i]
    min_list.append(min(K-left, K-right))
print(min(min_list))

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

min_list = []
for i in range(N):
    if i == 0:
        left = an[i] + K - an[-1]
        right = an[i+1] - an[i]
    elif i == N-1:
        left = an[i] - an[i-1]
        right = an[0] + K - an[N-1]
    else:
        left = an[i] - an[i-1]
        right = an[i+1] - an[i]
    min_list.append(min(K-left, K-right))
print(min(n_list))
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
# print(s[2:len(s)])
l = len(s)
count = 0


# for i, j in itertools.combinations(range(len(s)+1), 2):
#     if(int(s[i:j]) % 2019 == 0):
#         count = count + 1
#
# print(count)

for i in range(2019):
    count2 = 0
    for j in range(l):
        if int(s[j:l]) % 2019 == i:
            count2 = count2 + 1
    count = count + (count2 * (count2 - 1)) / 2
print(int(count))

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

for i in range(len(s)):
    for j in range(len(s) - i):
        if int(s[i:i+j+1]) % 2019 == 0:
            count = count + 1

print(count)
Problem p02729 (python)

Fixed submission:
import math

def inputlist(): return [int(i) for i in input().split()]

def kumiawase(num):
    r = 2
    if num != 1 and num != 0:
        return math.factorial(num) // (math.factorial(num - r) * math.factorial(r))
    else:
        return 0

def main():
    N, M = inputlist()
    print(kumiawase(N) + kumiawase(M))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def inputlist(): return [int(i) for i in input().split()]

def kumiawase(num):
    r = 2
    if num != 1 or num != 0:
        return math.factorial(num) // (math.factorial(num - r) * math.factorial(r))
    else:
        return 0

def main():
    N, M = inputlist()
    print(kumiawase(N) + kumiawase(M))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def inputlist(): return [int(i) for i in input().split()]

def kumiawase(num):
    r = 2
    if num != 1:
        return math.factorial(num) // (math.factorial(num - r) * math.factorial(r))
    else:
        return 0

def main():
    N, M = inputlist()
    print(kumiawase(N) + kumiawase(M))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def inputlist(): return [int(i) for i in input().split()]

def kumiawase(num):
    r = 2
    return math.factorial(num) // (math.factorial(num - r) * math.factorial(r))

def main():
    N, M = inputlist()
    print(kumiawase(N) + kumiawase(M))

if __name__ == '__main__':
    main()
Problem p02753 (python)

Fixed submission:
strStation = input()

if strStation == 'AAA' or strStation == 'BBB':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
initInput = input()
tmpList = initInput.split()
inputN = int(tmpList[0])
inputA = int(tmpList[1])
inputB = int(tmpList[2])
arrayList = []
num = 0
arrayNum = 0
blueballNum = 0
while len(arrayList)  < inputN:
    if num % 2 == 0:
        for a in range(inputA):
            arrayList = arrayList +  ['a']
            arrayNum = arrayNum + 1
            blueballNum = blueballNum + 1
    else:
        for b in range(inputB):
            arrayList = arrayList +  ['b']
            arrayNum = arrayNum + 1

    num += 1

blueballNum = blueballNum - (len(arrayList) - inputN)
    
print(blueballNum)
Problem p02699 (python)

Fixed submission:
S, W = input().split(' ')
print('unsafe') if int(S) <= int(W) else print('safe')

Buggy submission (verdict: Runtime Error):
print('unsafe') if int(input()) <= int(input()) else print('safe')
Problem p03804 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def solve(N, M, A, B):
    include = False
    for h in range(N-M+1):
        for w in range(N-M+1):
            match = True
            for i in range(M):
                for j in range(M):
                    if(A[h+i][w+j] != B[i][j]):
                        match = False
            if(match):
                include = True

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

if __name__ == '__main__':
    N, M = map(int, input().split())
    A, B = [], []
    for i in range(N):
        A.append(input())
    for j in range(M):
        B.append(input())

    solve(N, M, A, B)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def solve(N, M, A, B):
    
    include = False
    for h in range(N-M+1):
        for w in range(N-M+1):
            match = True
            for i in range(M):
                for j in range(M):
                    if(A[h+i][w+j] != B[i][j]):
                        match = False
            if(match):
                include = True
    
    print("Yes" if include else "No")
    
    
if __name__ == '__main__':
    N, M = map(int, input().split())
    A, B = [], []
    for i in range(N):
        A.append(input())
    for j in range(M):
        B.append(input())

    solve(N, M, A, B
Problem p02693 (python)

Fixed submission:
k=input()
a,b=input().split()
c=int(a)
d=int(b)
l=int(k)
e=d-d%l
if e>=c:
  print('OK')
else:
  print('NG')

Buggy submission (verdict: Runtime Error):
k = input("整数kを入力してください")
a = input("整数aを入力してください")
b = input("整数bを入力してください")
c = int(a)
d = int(b)
l = int(k)
e = d-d%l
if e>=c:
    print('ok')
else:
    print('ng')