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

Fixed submission:
n,m = list(map(int, input().split()))
a=[]
b=[]
c=[]
d=[]
y=0
for i in range(n):
    tmp=list(map(int, input().split()))
    a.append(tmp[0])
    b.append(tmp[1])
for i in range(m):
    tmp=list(map(int, input().split()))
    c.append(tmp[0])
    d.append(tmp[1])
for i in range(n):
    x=[1000000000]*m
    for j in range(m):
        x[j]=abs(c[j]-a[i])+abs(d[j]-b[i])
        if x[y] > x[j]:
            y = j
    print(y+1)
    y=0

Buggy submission (verdict: Runtime Error):
n,m = list(map(int, input().split()))
a=[]
b=[]
c=[]
d=[]
y=0
for i in range(n):
    tmp=list(map(int, input().split()))
    a.append(tmp[0])
    b.append(tmp[1])
for i in range(m):
    tmp=list(map(int, input().split()))
    c.append(tmp[0])
    d.append(tmp[1])
x=[1000000000]*n
for i in range(n):
    for j in range(m):
        x[j]=abs(c[j]-a[i])+abs(d[j]-b[i])
        if x[y] > x[j]:
            y = j
    print(y+1)
    y=0
Problem p03774 (python)

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

nodes, checks = [], []
for i in range(N):
    nodes.append(list(map(int, input().split())))

for j in range(M):
    checks.append(list(map(int, input().split())))

for i in range(N):
    argMin, distMin = None, float('inf')
    for j in range(M):
        dist = abs(nodes[i][0] - checks[j][0]) + abs(nodes[i][1] - checks[j][1])
        if dist < distMin: argMin, distMin = j, dist
    print(argMin + 1)

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

nodes, checks = [], []
for i in range(N):
    nodes.append(map(int, input().split()))
for j in range(M):
    checks.append(map(int, input().split()))

for i in range(N):
    argMin, distMin = None, float('inf')
    for j in range(M):
        dist = abs(nodes[i][0] - checks[j][0]) + abs(nodes[i][1] - checks[j][1])
        if dist < distMin: argMin, distMin = j, dist
    print(j)
Problem p03785 (python)

Fixed submission:
N,C,K = map(int, raw_input().split(" "))
timelist = []
for i in range(0, N):
    timelist.append(int(raw_input()))
timelist.sort()


class Foo:

    timelist = []
    buslist = []
    firstId = 0
    capacity = 0

    def __init__(self, timelist):
        self.timelist = timelist

    def addBus(self, i):
        self.buslist.append(self.timelist[i])
        self.firstId  = i + 1
        self.capacity = 0

    def calc(self):
        for i in range(0, N):

            if i == N - 1:
                self.addBus(i)
                break

            nexttime = self.timelist[i + 1]

            self.capacity += 1
            # timeover
            if nexttime > timelist[self.firstId] + K:
                self.addBus(i)
                continue

            # capacity over
            if self.capacity >= C:
                self.addBus(i)
                continue


    def printBusList(self):
        for bus in self.buslist:
            print(bus)

    def printTotalBusNum(self):
        print(len(self.buslist))


foo = Foo(timelist)
foo.calc()
foo.printTotalBusNum()

Buggy submission (verdict: Runtime Error):
FILE = open("coderData.txt", 'r')

def raw_input():
    return FILE.readline()

N,C,K = map(int, raw_input().split(" "))
timelist = []
for i in range(0, N):
    timelist.append(int(raw_input()))
timelist.sort()


class Foo:

    timelist = []
    buslist = []
    firstId = 0
    capacity = 0

    def __init__(self, timelist):
        self.timelist = timelist

    def addBus(self, i):
        self.buslist.append(self.timelist[i])
        self.firstId  = i + 1
        self.capacity = 0

    def calc(self):
        for i in range(0, N):

            if i == N - 1:
                self.addBus(i)
                break

            nexttime = self.timelist[i + 1]

            self.capacity += 1
            # timeover
            if nexttime > timelist[self.firstId] + K:
                self.addBus(i)
                continue

            # capacity over
            if self.capacity >= C:
                self.addBus(i)
                continue


    def printBusList(self):
        for bus in self.buslist:
            print(bus)

    def printTotalBusNum(self):
        print(len(self.buslist))


foo = Foo(timelist)
foo.calc()
foo.printTotalBusNum()
Problem p03767 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  1 22:07:55 2017

@author: taichiNakamura
"""
import numpy as np
N = int(input())
# スペース区切りの整数の入力
num = list(map(int, input().split()))

num = np.array(num, dtype="int64")
num.sort()
sum = 0

for i in range(N):
    sum += num[3*N - 2 - i*2]
# 出力
print(sum)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  1 22:07:55 2017

@author: taichiNakamura
"""

N = int(input())
# スペース区切りの整数の入力
num = map(int, input().split())

import numpy as np
num = np.array(num)
num = np.sort(num)
sum = 0
for i in range(N):
    sum += num[3*N - 2 - i*2]
# 出力
print(sum)
Problem p03776 (python)

Fixed submission:
import math

# def comboSum(n, chooseMin, chooseMax):
# 	print(n, chooseMin, chooseMax)
# 	ways = 0
# 	for i in range(chooseMin, chooseMax + 1):
# 		localWays = math.factorial(n) // math.factorial(i) // math.factorial(n - i)
# 		ways += localWays
# 	return ways


def avg(L, atLeast, atMost):
	if (L.count(max(L)) >= atLeast):
		print(max(L))
		ways = 0
		for i in range(atLeast, min(atMost, L.count(max(L))) + 1):
			localWays = math.factorial(L.count(max(L))) // math.factorial(i) // math.factorial(L.count(max(L)) - i)
			ways += localWays
		print(ways)
		return
	L.sort(reverse=True)
	last = L[atLeast - 1]
	print(sum(L[:atLeast]) / atLeast)
	firstIndex = L.index(last)
	# lastIndex = len(L) - (sorted(L).index(last)) - 1
	n = L.count(last)
	i = atLeast - firstIndex
	print(math.factorial(n) // math.factorial(i) // math.factorial(n - i))

[N, atLeast, atMost] = list(map(lambda x: int(x), input().split()))
L = list(map(lambda x: int(x), input().split()))
avg(L, atLeast, atMost)

Buggy submission (verdict: Runtime Error):
import math

def avg(L, atLeast, atMost):
	if (L.count(max(L)) >= atLeast):
		print(max(L))
		ways = 0
		for i in range(atLeast, atMost + 1):
			localWays = math.factorial(L.count(max(L))) // math.factorial(i) // math.factorial(L.count(max(L)) - i)
			ways += localWays
		print(ways)
		return
	L.sort(reverse=True)
	last = L[atLeast - 1]
	print(sum(L[:atLeast]) / atLeast)
	print(L.count(last))

[N, atLeast, atMost] = list(map(lambda x: int(x), input().split()))
L = list(map(lambda x: int(x), input().split()))
avg(L, atLeast, atMost)
Problem p03775 (python)

Fixed submission:
import math

def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count


N=int(input())
mi=10
for i in range(1,int(N/math.sqrt(N)+1)):
    if N%i==0:
        j=int(N/i)
        if mi>max(keta(i),keta(j)):
            mi=max(keta(i),keta(j))

print(mi)

Buggy submission (verdict: Runtime Error):
def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count

stac=[]
N=int(input())
for i in range(1,int(N/2+1)):
    if N%i==0:
        j=int(N/i)
        stac.append(max(keta(i),keta(j)))

print(min(stac))
Problem p03775 (python)

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

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while i * i <= n:
    if n % i == 0:
        ans = n / i
        #ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)

Buggy submission (verdict: Runtime Error):

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = n / i
        #ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)

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

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = n / i
        ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)

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

import math

n = int(raw_input())

i = 1
sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = int(math.log10(n / i)) + 1
    i += 1
print(ans)
Problem p03834 (python)

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

a,b,c = map(str, raw_input().split(","))
print a+ " "+b+" "+c

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

# カンマ区切りの文字の入力
a,b,c = map(str, raw_input().split(","))
# 文字列の入力
print a+ " "+b+" "+c
Problem p03803 (python)

Fixed submission:
a,b = map(int, raw_input().split())
ap = (a+11)%13
bp = (b+11)%13
if ap > bp:
  print "Alice"
elif ap < bp:
  print "Bob"
else:
  print "Draw"

Buggy submission (verdict: Runtime Error):
a,b = map(int, raw_input().split())
ap = (a+11)%12
bp = (b+11)%12
if ap > bp:
  print "Alice"
elif ap < bp:
  print "Bob"
else:
  print Draw
Problem p03804 (python)

Fixed submission:
n,m = map(int, raw_input().split())
np=[]
mp=[]
for i in xrange(0, n):
  np.append(raw_input())
for i in xrange(0, m):
  mp.append(raw_input())
 
for i in xrange(0,n-m+1):
  for j in xrange(0, n-m+1):
    flag = True
    for x in xrange(0, m):
      for y in xrange(0, m):
        if mp[x][y] != np[i+x][j+y]:
          flag = False
          break
      if flag == False:
        break
    if flag:
      print "Yes"
      break
  if flag: break
if flag==False: print "No"

Buggy submission (verdict: Runtime Error):
for i in xrange(0,n-m+1):
  for j in xrange(0, n-m+1):
    flag = True
    for x in xrange(0, m):
      for y in xrange(0, m):
        if mp[x][y] != np[i+x][j+y]:
          flag = False
          break
      if flag == False:
        break
    if flag:
      print "Yes"
      break
  if flag: break
if flag==False: print "No"

Buggy submission (verdict: Runtime Error):
n,m = map(int, raw_input().split())
np=[]
mp=[]
for i in xrange(0, n):
  np.append(raw_input())
for i in xrange(0, m):
  mp.append(raw_input())

for i in xrange(0,n-m+1):
  for j in xrange(0, n-m+1):
    flag = True
    for x in xrange(0, m):
      for y in xrange(0, m):
        if mp[x][y] != np[i+x][j+y]:
          flag = False
          break
      if flag == False:
        break
    if flag:
      print "Yes"
      return
print "No"

Buggy submission (verdict: Runtime Error):
np=[]
mp=[]
for i in xrange(0, n):
  np.append(raw_input())
for i in xrange(0, m):
  mp.append(raw_input())

for i in xrange(0,n-m):
  for j in xrange(0, n-m):
    flag = True
    for l in xrange(0, m):
      for m in xrange(0, n):
        if mp[l][m] != np[i][j]:
          flag = False
          break
      if !flag:
        break

if flag:
  print "Yes"
else:
  print "No"
Problem p03821 (python)

Fixed submission:

N = int(input())
total = 0
A = [None] * N
B = [None] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())
	
for i in range(N-1,-1,-1):
	b = A[i] + total
	a = b % B[i]
	if a == 0:
		pass
	else:
		total = total + B[i] - a


print (total)

Buggy submission (verdict: Runtime Error):

N = int(input())
total = 0
A = [None] * N
B = [None] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())
	
for t in range(N):
	i = N + 1 - t
	a = A[i] % B[i]
	if a == 0:
		pass
	else:
		total = B[i]-a:
		for j in range (i):
			A[i] = A[i] + B[i] - a


print (total)
Problem p03803 (python)

Fixed submission:
a, b = map(int, input().split())
c = [13,1,2,3,4,5,6,7,8,9,10,11,12]

if c[a-1] > c[b-1]:
    print('Alice')
elif c[a-1] < c[b-1]:
    print('Bob')
else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = [13,1,2,3,4,5,6,7,8,9,10,11,12]

if c[a] > c[b]:
    print('Alice')
elif c[a] < c[b]:
    print('Bob')
else:
    print('Draw')
Problem p03805 (python)

Fixed submission:
def main():

    n, m = map(int, input().split())
    tree = [[]*n for i in range(n)]
    l = [list(map(int, input().split())) for _ in range(m)]
    
    for i in l:
        tree[i[0]-1].append(i[1]-1)
        tree[i[1]-1].append(i[0]-1)

    ver = [i for i in range(n)]

    cnt = 0

    def dfc(now, moved):
        
        nonlocal cnt
     
        moved.sort()
        if moved == ver:
            cnt += 1

        for i in tree[now]:
            if i in moved:
                continue
            dfc(i, moved + [i])

    dfc(0, [0])
    print(cnt)
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = map(int, input().split())
    mat = [[0]*n for i in range(n)]
    l = [list(map(int, input().split())) for _ in range(m)]

    for i in range(n):
        mat[l[i][0]-1][l[i][1]-1] = 1
        mat[l[i][1]-1][l[i][0]-1] = 1

    
    ver = [i for i in range(n)]

    cnt = 0

    def dfc(now, moved):
        
        nonlocal cnt

        moved.sort()
        if moved == ver:
            cnt += 1
        
        for i in range(n):
            if (mat[now][i] == 0) or (i in moved):
                continue
            
            dfc(i, moved + [i])

    dfc(0, [0])
    print(cnt)
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
 
    n, m = map(int, input().split())
    mat = [[0]*n for i in range(n)]
    l = [list(map(int, input().split())) for _ in range(m)]

    for i in range(n):
        mat[l[i][0]-1][l[i][1]-1] = 1
        mat[l[i][1]-1][l[i][0]-1] = 1

    
    ver = [i for i in range(n)]

    cnt = 0

    def dfc(now, moved):
        
        nonlocal cnt

        moved.sort()
        if moved == ver:
            cnt += 1
        
        for i in range(n):
            if (mat[now][i] == 0) or (i in moved):
                continue
            
            dfc(i, moved + [i])

    dfc(0, [0])
    print(cnt)
    
if __name__ == "__main__":
    main()
def main():

    n, m = map(int, input().split())
    tree = [[]*n for i in range(n)]
    l = [list(map(int, input().split())) for _ in range(m)]
    
    for i in l:
        tree[i[0]-1].append(i[1]-1)
        tree[i[1]-1].append(i[0]-1)

    ver = [i for i in range(n)]

    cnt = 0

    def dfc(now, moved):
        
        nonlocal cnt
     
        moved.sort()
        if moved == ver:
            cnt += 1

        for i in tree[now]:
            if i in moved:
                continue
            dfc(i, moved + [i])

    dfc(0, [0])
    print(cnt)
    
if __name__ == "__main__":
    main()
Problem p03803 (python)

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


if A == 1 or B == 1:
    if A == B:
        print("Draw")
        exit()
    elif A == 1 and A < B:
        print("Alice")
        exit()
    elif B == 1 and B < A:
        print("Bob")
        exit()

if A < B :
    print("Bob")
elif A > B:
    print("Alice")
else :
    print("Draw")

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

def check(i,j):
    for row in range(m):
        for col in range(m):
            if a[row + i][col + j] == b[row][col]:
                return True

    return False
for i in range(n-m+1):
    for j in range(n-m+1):
        if check(i,j):
            print("Yes")
            exit()


print("No")
Problem p03803 (python)

Fixed submission:
a, b = [int(i) for i in input().split()]

if a == 1: a = 14
if b == 1: b = 14

if a < b:
    print('Bob')
elif b < a:
    print('Alice')
else:
    print('Draw')

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

if a == 1: a = 14
if b == 1: b = 14

if a < b:
    print('Bob')
elif b < a:
    print('Alice')
else:
    print('Draw')
Problem p03803 (python)

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

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print "Alice"
elif a < b:
	print "Bob"
else:
	print "Draw"

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

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print "Alice"
elif a < b:
	print "Bob"
else:
	print "Draw"

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

if a == 1:
	a = 14

if b == 1:
	b = 14

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

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

if a == 1:
	a = a + 13

if b == 1:
	b = b + 13

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

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

if a == 1
	a = a + 13

if b == 1
	b = b + 13

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

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

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

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

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")
Problem p03803 (python)

Fixed submission:
lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a==1:
    if b==1:
        print("Draw")
    else :
        print("Alice")
elif b==1:
    print("Bob")
else :
    if a>b:
        print("Alice")
    elif a==b:
        print("Draw")
    else :
        print("Bob")

Buggy submission (verdict: Runtime Error):
lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a=1:
    if b=1:
        print(Draw)
    else :
        print(Alice)
elif b=1:
    print(Bob)
else :
    if a>b:
        print(Alice)
    elif a=b:
        print(Draw)
    else :
        print(Bob)
Problem p03803 (python)

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

A = raw_input()
B = A.split()
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C > D:
      print 'Alice'
    elif C < D:
      print 'Bob'
    else:
      print 'Draw'

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

A = raw_input()
B = A.split()
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C ＞ D:
      print 'Alice'
    elif C ＜ D:
      print 'Bob'
    else:
      print 'Draw'

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

A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C ＞ D:
      print 'Alice'
    elif C ＜ D:
      print 'Bob'
    else:
      print 'Draw'

Buggy submission (verdict: Runtime Error):
{1:14}
A = raw_input()
A.split( )

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
A = raw_input()
A.split( )

{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
A = raw_input()
A.split(' ')

{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
A = int(raw_input())
A.split(' ')

{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
A = int(raw_input())
A.split( )

{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
A = raw_input(('A='))
B = raw_input(('B='))

if A == 1:
  A = 1

if B == 1:
  B = 1

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
{1:14}

A = raw_input('A=')
B = raw_input('B=')

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Buggy submission (verdict: Runtime Error):
{1:14}

A = raw_input('A=')
B = raw_input('B=')

if int(A) == int(B)
  print 'Draw'

elif int(A) ＞ int(B)
  print 'Alice'

elif int(B) ＞ int(A)
  print 'Bob'
Problem p03803 (python)

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

A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C > D:
      print 'Alice'
    elif C < D:
      print 'Bob'
    else:
      print 'Draw'

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

A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C ＞ D:
      print 'Alice'
    elif C ＜ D:
      print 'Bob'
    else:
      print 'Draw'

Buggy submission (verdict: Runtime Error):
A = jnt(raw_input('A='))
B = int(raw_input('B='))
if A == 1
  A = A + 13
  if B == 1
    B = B + 13
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'

  elif B != 1
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'

  elif A != 1
    if A == B
      print 'Draw'
    elif A ＞ B
      print 'Alice'
    elif B ＞ A
      print 'Bob'
Problem p03803 (python)

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

if a == 1:
    a += 13
if b == 1:
    b += 13

if a > b:
    print("Alice")
elif b > a:
    print("Bob")
else:
    print("Draw")

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

print str(a+b+c) + " " + s
Problem p03803 (python)

Fixed submission:
# get Alice's card A and Bob's card B
a, b = map(int, raw_input().split())

# adjust for card strength, 1 > 13
if a == 1:
	a = 14
if b == 1:
	b = 14

if a > b:
	print ("Alice")
elif a < b:
	print ("Bob")
else:
	print ("Draw")

Buggy submission (verdict: Runtime Error):
# get Alice's card A and Bob's card B
a, b = map(int, raw_input().split())

# adjust for card strength, 1 > 13
if a == 1:
	a = 14
if b == 1:
	b = 14

if a > b:
	print ("Alice")
elif a < b:
	print ("Bob")
else:
	print ("Draw")
Problem p03803 (python)

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

if a==b:
	print "Draw"
else:
	if a!=1 and b!=1:
		if a<b:
			print "Bob"
		else:
			print "Alice"
	elif a==1 and b!=1:
		print "Alice"
	else:
		print "Bob"

Buggy submission (verdict: Runtime Error):
n,m = map(int, raw_input().split())
n_list = [] #row major format
m_list = []
for i in range(0, n):
	n_list.append(raw_input())

for x in range(0, m):
	m_list.append(raw_input())

def match_first_rows(n_start):
	result = (-1,-1)
	first_m = m_list[0] # first row
	for x in range(n_start, n):
		n_row = n_list[x]
		if first_m in n_row: # substring matching of first m_row
			j = n_row.index(first_m)
			return (x, j)
	return (-1,-1) #return -1,-1 if none found

# given the leftmost corner of matching in matrix n, start matching each row to see if there is a potential match
# only guranteed first row match
def begin_matching(i,j):
	nx_start = i
	ny_start = j
	for x in range(0,m):
		n_row_string = n_list[nx_start+x]
		n_string = n_row_string[j:j+m] # align window
		m_string = m_list[x]
		if n_string!=m_string:
			return False
	return True

def find_m():

	found_m = False
	counter = 0
	while(counter<=n-m and not(found_m)):

		i,j = match_first_rows(counter)
		if i==-1: 
			#goes through entirety, not returning things at all
			print("No")
			found_m = True
		# found a potential starting point
		else:
			result = begin_matching(i,j)
			if result:
				print("Yes")
				found_m = True
			else:
				#do it again, but one row lower
				counter +=1 

find_m()

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

if a==b:
	print("Draw")
else:
	if a!=1 and b!=1:
		if a<b:
			print("Bob")
		else:
			print("Alice")
	elif a==1 and b!=1:
		print("Alice")
	else:
		print("Bob")