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

Fixed submission:
import sys
#import bisect
#from collections import deque
import math

def input():
    return sys.stdin.readline().rstrip('\n')


X,Y = list(map(int, input().split()))

if (2*X-Y) % 3:
    print(0)
    sys.exit()

if (2*Y-X) % 3:
    print(0)
    sys.exit()

M = max((2*X-Y)//3, (2*Y-X)//3)
N = min((2*X-Y)//3, (2*Y-X)//3)

if M<0 or N<0:
    print(0)
    sys.exit()
    
mod = pow(10,9) + 7

#from scipy.special import comb
#print(comb(M+N,N) % (pow(10,9) + 7))
#print(comb(M+N,N, exact=True)% (pow(10,9) + 7))  causes "RE" at atcoder
#from math import factorial
#print((factorial(M+N)//factorial(M)//factorial(N)))

def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def ohmycomb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

print(ohmycomb(M+N, N, mod))

Buggy submission (verdict: Runtime Error):
import sys
#import bisect
#from collections import deque
import math

def input():
    return sys.stdin.readline().rstrip('\n')


X,Y = list(map(int, input().split()))

if (2*X-Y) % 3:
    print(0)
    sys.exit()

if (2*Y-X) % 3:
    print(0)
    sys.exit()

M = max((2*X-Y)//3, (2*Y-X)//3)
N = min((2*X-Y)//3, (2*Y-X)//3)

from scipy.special import comb
#print(comb(M+N,N) % (pow(10,9) + 7))
print(comb(M+N,N, exact=True)% (pow(10,9) + 7))
Problem p03012 (python)

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

T = N
DIFFMIN = 100000
lidx = 0
ridx = N-1

while(True):
    T = (lidx + ridx)//2
    if T == N-1:
        T -= 1

    L = sum(W[:T+1])
    R = sum(W[T+1:])
    #print(T, L, R)
    if ridx - lidx <= 1:
        DIFFMIN = min(abs(L-R), abs(sum(W[:T+2])-sum(W[T+2:])))
        break
    if L<R:
        lidx = T
    elif L>R:
        ridx = T
    else:
        DIFFMIN = abs(L-R)
        break
    DIFFMIN = abs(L-R)
    
print(DIFFMIN)

Buggy submission (verdict: Runtime Error):
import sys
from scipy.special import comb

N,M = list(map(int, input().split()))

A = [0]*M

for i in range(M):
    A[i] = int(input())

A.append(N+1)

total_combo = 1
NOW = 0
for a in A:
    if NOW == a:
        print(0)
        sys.exit()
    L = a-1-NOW
    combo = 0
    for i in range(L//2 +1):
        j = L - 2*i
        combo += comb(j+1, i, exact=True)
    total_combo *= combo
    NOW = a + 1
    
print(total_combo)
Problem p03045 (python)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

# scipy version

import sys
from collections import deque
from array import array

import numpy

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components

def input():
    return sys.stdin.readline().rstrip('\n')

##### main

N,M = list(map(int, input().split()))

#C = [[0]*N for _ in range(N)]
#
#for i in range(M):
#    a,b,c = list(map(int, input().split()))
#    C[a-1][b-1] = c

R = numpy.full(M, 0, dtype=numpy.int32)
C = numpy.full(M, 0, dtype=numpy.int32)
V = numpy.full(M, 0, dtype=numpy.int32)

for i in range(M):
    r,c,v = list(map(int, input().split()))
    R[i] = r-1
    C[i] = c-1
    V[i] = v

matrix = csr_matrix((V,(R,C)), shape=(N,N))

n = connected_components(matrix, directed=False, return_labels=False)

print(n)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

# scipy version

import sys
from collections import deque
from array import array

import numpy

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components

def input():
    return sys.stdin.readline().rstrip('\n')

##### main

N,M = list(map(int, input().split()))

#C = [[0]*N for _ in range(N)]
#
#for i in range(M):
#    a,b,c = list(map(int, input().split()))
#    C[a-1][b-1] = c

R = numpy.full(N, 0, dtype=numpy.int32)
C = numpy.full(N, 0, dtype=numpy.int32)
V = numpy.full(N, 0, dtype=numpy.int32)

for i in range(M):
    r,c,v = list(map(int, input().split()))
    R[i] = r-1
    C[i] = c-1
    V[i] = v

matrix = csr_matrix((V,(R,C)), shape=(N,N))

n = connected_components(matrix, directed=False, return_labels=False)

print(n)
Problem p02847 (python)

Fixed submission:
s=input()
l=['SUN','MON','TUE','WED','THU','FRI','SAT']
l.reverse()
print(l.index(s)+1)

Buggy submission (verdict: Runtime Error):
 s=input()
 l=['SUN','MON','TUE','WED','THU','FRI','SAT']
 l.reverse()
 print(l.index(s)+1)
Problem p03073 (python)

Fixed submission:
a=list(input())
b=a[::-1]
n=len(a)
if n==1:
    print(0)
else:
    x=0
    y=0
    for i in range(n-1):
        if a[i]==a[i+1]:
            x+=1
            if a[i]=='0':
                a[i+1]='1'
            else:
                a[i+1]='0'
        if b[i]==b[i+1]:
            y+=1
            if b[i]=='0':
                b[i+1]='1'
            else:
                b[i+1]='0'
    print(min(x,y))

Buggy submission (verdict: Runtime Error):
l=[*input()]
s=0
for i in range(1,len(l)):
    if l[i-1]==l[i]:
        s+=1
        if l[i]=='1':
            l[i]='0'
        else:
            l[i]='1'
print(s)

Buggy submission (verdict: Runtime Error):
a=[*input()]
b=a[::-1]
n=len(a)
if n==1:
    print(0)
else:
    x=0
    y=0
    for i in range(n-1):
        if a[i]==a[i+1]:
            x+=1
            if a[i]=='0':
                a[i+1]='1'
            else:
                a[i+1]='0'
        if b[i]==b[i+1]:
            y+=1
            if b[i]=='0':
                b[i+1]='1'
            else:
                b[i+1]='0'
    print(min(x,y))

Buggy submission (verdict: Runtime Error):
a=[*input()]
b=a[::-1]
n=len(a)
if n==1:
    print(0)
else:
    x=0
    y=0
    for i in range(n-1):
        if a[i]==a[i+1]:
            x+=1
            if a[i]=='0':
                a[i+1]='1'
            else:
                a[i+1]='0'
        if b[i]==b[i+1]:
            y+=1
            if b[i]=='0':
                b[i+1]='1'
            else:
                b[i+1]='0'
    print(min(x,y))
Problem p02829 (python)

Fixed submission:
l = [1,2,3]
a = int(input())
b = int(input())
c = [o for o in l if o not in [a,b]]
print(c[0])

Buggy submission (verdict: Runtime Error):
inp = [int(o) for o in input().split(" ")]
n = 0

while True:
  n += 1
  if n % inp[0] != 0:
    pass
  elif n % inp[1] != 0:
    pass
  else:
    break
print(n)

Buggy submission (verdict: Runtime Error):
inp_1 = input()
inp_2 = input().split(" ")
r = ""

for i in range(inp_1):
  r += inp_2[0][i]
  r += inp_2[1][i]

print(o)

Buggy submission (verdict: Runtime Error):
l = [1,2,3]
a = int(input())
b = int(input())
c = [o for o in l if o in not [a,b]]
print(c[0])
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())


# A = 3
# B = 1
print(6 - A- B)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

A,B = map(int, input().split())

print(int(A * B / gcd(A, B)))
Problem p02831 (python)

Fixed submission:
from fractions import gcd

A,B = map(int, input().split())

print(int(A * B / gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import math

A,B = map(int, input().split())

print(int(A * B / math.gcd(A, B)))
Problem p02897 (python)

Fixed submission:
import sys
import math
N = int(sys.stdin.readline())
# import decimal


odd = []
oddness = []


for i in range(N):
    j = i + 1
    if j % 2 != 0:
        odd.append(j)

# decimal.getcontext().prec = 7
# print(decimal.Decimal(len(odd)) / decimal.Decimal(j))
answer = float(len(odd)) / float(j)
print(answer)

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

# import decimal
import math


odd = []
oddness = []


for i in range(S):
    j = i + 1
    if j % 2 != 0:
        odd.append(j)

# decimal.getcontext().prec = 7
# print(decimal.Decimal(len(odd)) / decimal.Decimal(j))
answer = len(odd) / j

print(round(answer, 7))
Problem p02829 (python)

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

list=[1, 2, 3]

list.remove(a)
list.remove(b)

print(list[0])

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

list=[1, 2, 3]

list.pop(a)
list.pop(b)

print(list[0])
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()))

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

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()))

ans = 0
for i in range(0,n):
    ans += b[a[i]-1]
    if i != 0 and a[i-1]+1 == a[i]:
        ans += c[a[i]-1]
print(ans)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
if input(a) >= 3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
if input(a) >= 3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
count = 0
for i in range(0,3):
    if s[i] == t[i]:
        count += 1
print(count)
Problem p02881 (python)

Fixed submission:
n = int(input())
li = []

for x in range(1, int(n ** 0.5)+1):
  if n % x == 0:
    y = n/x
    li.append(x+y-2)  
     
result = min(li) 
print(int(result))

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

for x in range(n):
  for y in range(n):
    if x * y == n:
      li.append(x+y-2)

result = min(li) 
print(result)
Problem p02831 (python)

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

def gcd(A, B):
    x = max(A, B)
    y = min(A, B)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        else:
            return z

def lcd(A, B):
    return A * B // gcd(A, B)

print(lcd(A, B))

Buggy submission (verdict: Runtime Error):
import math

data = list(map(int, input().split()))
A, B = data[0], data[1]
g = math.gcd(A, B)
lcd = int(A*B/g)
print(lcd)

Buggy submission (verdict: Runtime Error):
import math

data = list(map(int, input().split()))
A, B = data[0], data[1]
gcd = math.gcd(A, B)
lcd = A*B//gcd
print(lcd)

Buggy submission (verdict: Runtime Error):
import math

data = list(map(int, input().split()))
A, B = data[0], data[1]
gcd = math.gcd(A, B)
print(A*B//gcd)

Buggy submission (verdict: Runtime Error):
import math

data = list(map(int, input().split()))
A, B = data[0], data[1]
gcd = math.gcd(A, B)
print(int(A*B/gcd))
Problem p02833 (python)

Fixed submission:
from sys import exit

N = int(input())
if N < 2:
    F = 1
    print(0)
    exit()
elif N % 2 == 1:
    print(0)
    exit()
else:
    t = 10
    result = 0
    while t <= N:
        result += N // t
        t = t * 5
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N < 2:
    F = 1
    print(0)
elif N % 2 == 1:
    print(0)
else:
    t = 10
    result = 0
    while t <= N:
        result += N // t
        t = t * 5
print(result)
Problem p02829 (python)

Fixed submission:
a, b = map(int, [input() for i in range(2)])
result = 6-a-b
print(result)

Buggy submission (verdict: Runtime Error):
a, b = map(int, [input() for i in range(2)])
result = 6-a-b
return result
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(x,y):
    return(x*y)//fractions.gcd(x,y)

a,b = map(int,input().split())
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x,y):
    return(x*y)//math.gcd(x,y)

a,b = map(int,input().split())
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x,y):
    return(x*y)//math.gcd(x,y)

a,b = map(int,input().split())
print(lcm(a,b))
Problem p02847 (python)

Fixed submission:
a = input()
if a == 'SUN':
  print(7)
elif a == 'MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  print(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)

Buggy submission (verdict: Runtime Error):
a = input()
if a == SUN:
  print(7)
elif a == MUN:
  print(6)
elif a==TUE:
  print(5)
elif a==WEN:
  print(4)
elif a==THU:
  print(3)
elif a==FRI:
  print(2)
elif a==SAT:
  print(1)
Problem p02829 (python)

Fixed submission:
a, b = input(), input()
#a,b=2,3
a,b= [int(i) for i in [a,b]]
all = [1,2,3]
result = list(filter(lambda x: not x in [a,b], all))
print(result[0])

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
#a,b=1,2
all = [1,2,3]
#result = next(filter(lambda x: x in [a,b], all))
result = filter(lambda x: not x in [a,b], all)
print(result[0])
Problem p02829 (python)

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

print(6-a-b)

Buggy submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

print((a * b) // math.gcd(a, b))

Buggy submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()
u = ""
for i in range(n):
    u = u + s[i] + t[i]

print(u)

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

for i in range(n):
    u = u + s[i] + t[i]

print(u)

Buggy submission (verdict: Runtime Error):
A= int,input()
B= int,input()
# A,Bの入力

print(6-A-B)
Problem p02831 (python)

Fixed submission:
import fractions
 
A, B = map(int, input().split())
 
print((A * B) // fractions.gcd(A, B))

Buggy submission (verdict: Runtime Error):
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b = map(int,input().split())

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b = map(int,input().split())

print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

a,b = map(int,input().split())

print(lcm(a,b))
Problem p02829 (python)

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

print(6-a-b)

Buggy submission (verdict: Runtime Error):
#入力
a=input()
b=input()
#選別
print(6-a-b)
Problem p02835 (python)

Fixed submission:
a1, a2, a3 = [int(i) for i in input().split()]

if(a1+a2+a3 >= 22):
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a1, a2, a3 = int(input().split(" "))

if(a1+a2+a3 >= 22):
  print("bust")
else:
  print("win")
Problem p02829 (python)

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

ans = 6-a-b
print(ans)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

ans = 6-a-b
print(ans)
Problem p03186 (python)

Fixed submission:
a, b, c = (int(i) for i in input().split())
if a + b + 1 > c:
    print(b + c)

else:
    print(2 * b + a + 1)

Buggy submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())
if a + b + 1 > c:
    return b + c

else:
    return 2 * b + a + 1
Problem p02829 (python)

Fixed submission:
A= int(input())
B= int(input())

ans = 6-A-B

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S,T=map(str,input().split())

cnt = 0
ans = ""

for cnt in range(N):
  ans=ans+S[cnt]+T[cnt]
  
print(ans)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
import heapq
N = int(input())
V = list(map(int, input().split()))
heapq.heapify(V)
for i in range(N-2):
  heapq.heappush((heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)
Problem p02935 (python)

Fixed submission:
import heapq
N = int(input())
V = list(map(int, input().split()))
 
heapq.heapify(V)
for i in range(N-2):
  heapq.heappush(V, (heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)

Buggy submission (verdict: Runtime Error):
import heapq
N = int(input())
V = list(map(int, input().split()))
heapq.heapify(V)
for i in range(N-2):
  heapq.heappush((heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)

Buggy submission (verdict: Runtime Error):
import heapq
N = int(input())
V = list(map(int, input().split()))
 
heapq.heapfy(V)
for i in range(N-2):
  heapq.heappush((heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)

Buggy submission (verdict: Runtime Error):
import heapq
N = input()
V = input().split()

heapq.heapfy(V)
for i in range(N-2):
  heapq.heappush((heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(a,b):
    print((a * b) // fractions.gcd(a,b))

a,b = [int(x) for x in input().split()]
lcm(a,b)

Buggy submission (verdict: Runtime Error):
import math

def lcm(a,b):
    print((a * b) // math.gcd(a,b))

a,b = [int(x) for x in input().split()]

lcm(a,b)
Problem p02879 (python)

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

if a >9 or b > 9:
    print("-1")
else:
    ans = a * b
    print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
array = []
for i in range(1,10):
    for j in range(1,10):
        array.append(i * j)
        
if n in array:
    print("Yes")
else:
    print("No")
Problem p02831 (python)

Fixed submission:
N = input()
L = N.split()
a = int(L[0])
b = int(L[1])

if a < b:
    c = a
    a = b
    b = c

r = a % b
    
while r != 0:
    a = b
    b = r
    r = a % b

# この時のbが最大公約数

print(int(int(L[0])*int(L[1])/b))

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

import math
print(a*b//math.gcd(a, b))

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

N = input()
l = N.split()

print(np.lcm(int(l[0]), int(l[1])))

Buggy submission (verdict: Runtime Error):
import math

input = input()
l = input.split()

print(math.gcd(int(l[0]), int(l[1])))
Problem p02829 (python)

Fixed submission:
a = input()
b = input()

ans = [1,2,3]

ans.remove(int(a))
ans.remove(int(b))

print(ans[0])

Buggy submission (verdict: Runtime Error):
ans = [1,2,3]
A = input()
B = input()

ans.del(A)
ans.del(B)

print(ans[0])
Problem p02831 (python)

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

line = input()
arr =  [int(n) for n in line.split(' ')]

print(lcm(*arr))

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

line = input()
arr =  [int(n) for n in line.split(' ')]

print(lcm(*arr))
Problem p02829 (python)

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

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

print(1)

Buggy submission (verdict: Runtime Error):
n = int(input())
s, t = input().split()
 
print(" ")

Buggy submission (verdict: Runtime Error):
n = int(input())
s, t = input().split()
 
res = ''
 
for i in range(n):
  res = res + str(s[i]) + str(t[i])
  
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
 
res = ''
 
for i in range(N):
  res = res + str(S[i]) + str(T[i])
  
print(res)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if (a != 3 and b != 3):
  print(str(3))
elif (a != 2 and B != 2):
  print(str(2))
else:
  print(str(1))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

print(1)

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
 
if (a != 3 and b != 3):
  print(str(3))
elif (a != 2 and B != 2):
  print(str(2))
else:
  print(str(1))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
 
if a != 3 and b != 3:
  print(str(3))
elif a != 2 and B != 2:
  print(str(2))
else:
  print(str(1))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
 
if a != 3 && b != 3:
  print(str(3))
elif a != 2 && B != 2:
  print(str(2))
else:
  print(str(1))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
 
if a != 3 && b != 3:
  print(str(3))
else if a != 2 && B != 2:
  print(str(2))
else:
  print(str(1))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
 
if a != 3 && b != 3:
  print(3)
else if a != 2 && B != 2:
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
a = raw_input()
b = raw_input()

if a != 3 && b != 3:
  print(3)
else if a != 2 && B != 2:
  print(2)
else:
  print(1)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
print(6 - a - b)

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

if (a == 1 or b == 2) and (a == 1 or b == 2):
    print(3)
elif (a == 2 or b == 3) and (a == 2 or b == 3):
    print(1)
else
    print(2)

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

if (a == 1 or b == 2) and (a == 1 or b == 2):
    print(3)
elif (a == 2 or b == 3) and (a == 2 or b == 3):
    print(1)
else
    print(2)

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

if (a == 1 || b == 2) && (a == 1 || b == 2):
    print(3)
elif (a == 2 || b == 3) && (a == 2 || b == 3):
    print(1)
else
    print(2)
Problem p02835 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A + B + C > 21:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A + B + C > 21:
    print("bust")
else
    print("win")
Problem p03011 (python)

Fixed submission:
list = [int(i) for i in input().split()] 
s = min(list)
list.remove(s)
t = min(list)
Time = s+t
print(Time)

Buggy submission (verdict: Runtime Error):
list = [int(i) for i in input().split()] 
s = min(list)
list.strip(s)
t = min(list)
Time = s+t
print(Time)
Problem p03012 (python)

Fixed submission:
N = int(input())
W = [int(i) for i in input().split()]
list = []


for i in range (N):
  s1 =0
  s2 =0
  slice1 =  W[0:i]
  for t in slice1:
    s1 += t
  slice2 = W[i:N]
  for t in slice2:
    s2 += t
  z = s1 - s2
  if z < 0:
    z*= -1
  list.append(z)
z =min(list)

print(z)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = [int(i) for i in input().split()]
for i in range (N):
  slice1 =  W[0,i]
  slice2 = W[i,0]
  print(slice1,slice2)



list.append(s1 -s2)
z =min(list)
print(z)

Buggy submission (verdict: Runtime Error):

list = [0,1,2,3,4,5,6,7]    
    
for i in list(0,3):
  s += i
  print(s)
Problem p02990 (python)

Fixed submission:
fac = []


def init():
    fac.append(1)
    for i in range(1, 2003):
        fac.append(fac[i - 1] * i)


def c(a, b):
    return fac[a] // fac[b] // fac[a - b]


init()
data = input().split(" ")
n = int(data[0])
b = int(data[1])
r = n - b
for i in range(1, b+1):
    print(int(c(b-1, i-1) * c(r+1, i) % int(1e9 + 7)))

Buggy submission (verdict: Runtime Error):
fac = []


def init():
    fac.append(1)
    for i in range(1, 2003):
        fac.append(fac[i - 1] * i)


def c(a, b):
    return fac[a] // fac[b] // fac[a - b]


init()
data = input().split(" ")
n = int(data[0])
b = int(data[1])
r = n - b
for i in range(1, b+1):
    print(int(c(b-1, i-1) * c(r+1, i) % (1e9 + 7)))
Problem p03186 (python)

Fixed submission:
A, B, C = map(int, input().split())

print(min(B+C, A+2*B+1))

Buggy submission (verdict: Runtime Error):
L, N = map(int, input().split())
X = [0] + [int(input()) for i in range(N)]
ans = 0
queue = [(0, 0, X[1], L-X[-1], 1, -1, 0)]

while queue:
    q = queue.pop()
    pos, path, l_len, r_len, l, r, cnt = q
    if(l-N-1 == r):
        path += max(l_len, r_len)
        ans = max(ans, path)
        continue
    if(l_len >= r_len):
        queue.append((l, path+l_len, X[l+1] - X[l],  l_len + r_len, l + 1, r, cnt+1))
    if(l_len <= r_len):
        queue.append((r, path+r_len, l_len + r_len,  X[r] - X[r-1], l, r - 1, cnt+1))

print(ans)
Problem p03631 (python)

Fixed submission:
n = input()
print("Yes" if(n[0]==n[2]) else "No")

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

lcm = 0
gcd = 0

for i in range(n):
    t = int(input())
    if(i == 0):
        lcm, gcd = t, t
        continue
    lcm = t
    r = gcd % t
    while(r!=0):
        lcm = r
        r = t % r
    gcd *= t
    gcd //= lcm
print(gcd)