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

Fixed submission:
S = input()
c0, c1 = 0,0
ans = 0
for ch in S:
  if c0 == 0 and ch == '1':
    c1 += 1
  elif c1 == 0 and ch == '0':
    c0 += 1
  elif ch == '1':
    ans += 2
    c0 -= 1
  else:
    ans += 2
    c1 -= 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
c0, c1 = 0,0
ans = 0
for ch in S:
  if c0 == 0 and ch = '1':
    c1 += 1
  elif c1 == 0 and ch = '0':
    c0 += 1
  elif ch == '1':
    ans += 2
    c0 -= 1
  else:
    ans += 2
    c1 -= 1
    
print(ans)
Problem p03107 (python)

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

string = input()

red_count  = string.count('0')
blue_count = string.count('1')

print(min(red_count, blue_count) * 2)

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

# 入力された文字列
string = input()

# 最大処理数。100000以下なら文字列長。
max = min(len(string), 100000)

# 削除した文字数
del_count = 0

# 削除する文字がなくなるまで処理を続ける
del_flg = True

while del_flg:
    del_flg = False
    for idx in range(max):
        target = string[idx : idx + 2]
        if target == "01" or target == "10":
            string_head = string[:idx]
            string_tail = string[idx + 2:]
            string = string_head + string_tail
            print(string)
            del_count += 2
            del_flg = True

print(del_count)
Problem p03135 (python)

Fixed submission:
x,t = map(int,input().split())
print(x/t)

Buggy submission (verdict: Runtime Error):
x,t = map(int,input.().split())
print(x/t)
Problem p03207 (python)

Fixed submission:
N = int(input())
p = []
for _ in range(N):
    p.append(int(input()))
 
pmax = max(p)
ans = int(sum(p)-pmax/2)
print(ans)

Buggy submission (verdict: Runtime Error):
input =int(input())
l = []
for x in range(input):
  l.append(int(input()))
  
ans = int(sum(l) -max(l)/2)
print(ans)

Buggy submission (verdict: Runtime Error):
aaa = int(input())
l = []
for x in range(aaa):
  l.append(int(input()))
  
print(int(sum(l) - max(l) + max(l/2)))

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
for _ in range(input):
  nums.append(int(input()))
print(0)

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
for x in range(input):
  nums.append(int(input()))
print(sum(nums))

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in range(input):
  nums.append(int(input()))
print(int(sum(nums)-max(nums) + max(nums)/2))

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in range(input):
  nums.append(int(input()))
print(sum(nums)-max(nums) + max(nums)/2)

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in range(input):
  nums.append(int(input()))
  if(input > max):
    max = input
print(sum(nums)-max + max/2)

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in range(input):
  nums.append(int(input()))
  if(input > max):
    max = input
  total += input
print(total-max + max/2)

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in input:
  nums.append(int(input()))
  if(input > max):
    max = input
for x in range (1,len(nums)):
  total +=x
print(total - max + max/2)

Buggy submission (verdict: Runtime Error):
input = int(input())
nums = []
max = 0
total = 0
for x in input:
  nums.append(input)
  if(input > max):
    max = input
for x in range (1,len(nums)):
  total +=x
print(total - max + max/2)
Problem p03135 (python)

Fixed submission:
tb, x = input().split()
ta = int(tb)/int(x)
print(ta)

Buggy submission (verdict: Runtime Error):
tb, x = input().split()
ta = tb/x
print(ta)
Problem p03107 (python)

Fixed submission:
string = str(input())
zero = 0
one = 0
chars = set(string)
for char in string:
    if char == list(chars)[0]:
        zero += 1
    else:
        one += 1

if zero == 0 or one == 0:
    print(0)
else:
    print(min(zero, one) * 2)

Buggy submission (verdict: Runtime Error):
string = str(input())
zero = 0
one = 0
for char in string:
    if char == list(chars)[0]:
        zero += 1
    else:
        one += 1

if zero == 0 or one == 0:
    print(0)
else:
    print(min(zero, one) * 2)

Buggy submission (verdict: Runtime Error):
string = str(input())

def take_zero_one(target, cnt=0):
    if len(target) <= 1:
        return (target, cnt)
    elif len(set(target)) == 1:
        return (target, cnt)

    prev = target[0]
    idx = 1
    while idx < len(target):
        if prev != target[idx]:
            cnt += 2
            remaining = target[:idx-1] + target[idx+1:]
            break

        prev = target[idx]
        idx += 1

    remaining, cnt = take_zero_one(remaining, cnt)

    return (remaining, cnt)

_, cnt = take_zero_one(string)
print(cnt)

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

def take_zero_one(target, cnt=0):
    if len(target) <= 1:
        return (target, cnt)
    elif len(set(target)) == 1:
        return (target, cnt)

    prev = target[0]
    idx = 1
    while idx < len(target):
        if prev != target[idx]:
            cnt += 2
            remaining = target[:idx-1] + target[idx+1:]
            break

        prev = target[idx]
        idx += 1

    remaining, cnt = take_zero_one(remaining, cnt)

    return (remaining, cnt)

_, cnt = take_zero_one(string)
print(cnt)
Problem p03107 (python)

Fixed submission:
s = input()

count0 = s.count('0')
count1 = s.count('1')
print(min(count0, count1) * 2)

Buggy submission (verdict: Runtime Error):
s = input()
 
count = 0
 
def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str
 
def remove_cube(string, count):
  count = string.count('10')
  if count > 0:
    new_text = string.replace('10', '', count)
  count = string.count('01')
  if count > 0:
    new_text = string.replace('01', '', count)
  return new_text
 
string = s
can_remove = True
while can_remove:
  search_count = string.count('10')
  if search_count > 0:
    new_text = string.replace('10', '', search_count)
  else:
    search_count = string.count('01')
    if search_count > 0:
      new_text = string.replace('01', '', search_count)

  if new_text != string:
    string = new_text
    count += search_count * 2
    can_remove = True
  else:
    can_remove = False
 
print(count)

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

count = 0

def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str

def remove_cube(string):
  for i in range(0, len(string)):
    print(len(string))
    if i+1 >= len(string):
      return string
    elif string[i] != string[i+1]:
      string = str_del(string, i)
      string = str_del(string, i)
      return string

string = s
can_remove = True
while can_remove:
  removed = remove_cube(string)
  if removed != string:
    string = removed
    count += 2
    can_remove = True
  else:
    can_remove = False

print(count)
Problem p03272 (python)

Fixed submission:
n,i=map(int,input().split())
print(n-i+1)

Buggy submission (verdict: Runtime Error):
n.i=map(int,input().split())
print(n-i+1)
Problem p03127 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    
    c = a % b
    if c == 0:
        return b
    else:
        return gcd(b, c)

n = int(input())
A = list(map(int,input().split()))

g = A[0]
for i in range(1, n):
    g = gcd(g, A[i])

print(g)

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

gcd = A[0]
for i in range(1, n):
    gcd = math.gcd(gcd, A[i])

print(gcd)
Problem p03127 (python)

Fixed submission:
N = int(input())

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

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
        
a = A[0]
for i in range(N):
    a = gcd(a,A[i])

print(a)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)


N = int(input())

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

print(gcd(A))
Problem p03803 (python)

Fixed submission:
Score_Alice, Score_Bob = map(int, input().split())

if Score_Alice == 1 and Score_Bob == 1:
  print('Draw')
elif Score_Alice == 1 and Score_Bob != 1:
  print('Alice')
elif Score_Alice != 1 and Score_Bob == 1:
  print('Bob')
else:
  if Score_Alice > Score_Bob:
    print('Alice')
  elif Score_Alice < Score_Bob:
    print('Bob')
  else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
Score_Alice, Score_Bob = map(int, input().split())

if Score_Alice == 1 and Score_Bob == 1:
  print('Draw')
elif Score_Alice == 1 and Score_Bob != 1:
  print('Alice')
elif Score_Alice != 1 and Score_Bob == 1:
  print('Bob')
else:
  if Score_Alice > Score_Bob:
    print('Alice')
  elif Score_Alice < Scoer_Bob:
    print('Bob')
  else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
Score_Alice, Score_Bob = map(int, input().split())

if Score_Alice == 1 and Score_Bob == 1:
  print('Draw')
elif Score_Alice == 1 and Score_Bob != 1:
  print('Alice')
elif Score_Alice != 1 and Score_Bob == 1:
  print('Bob')
else:
  if Score_Alice > Score_Bob:
    print('Alice')
  elif Score_Alice < Scoer_Bob:
    print('Bob')
  else:
    print('Draw')
Problem p03107 (python)

Fixed submission:
str = input()
num0,num1 = 0,0
for i in range(len(str)):
	if str[i] == '0':
		num0 += 1
	elif str[i] == '1':
		num1 += 1
if num1 >= num0:
	count = num0*2
	print(count)
else:
	count = num1*2
	print(count)

Buggy submission (verdict: Runtime Error):
str = input()
p = 0
count = 0
while(True):
	if p >= len(str) - 1:
		break
	if str[p] != str[p+1]:
		newstr = str[0:p] + str[p+2:]
		p -= 1
		count += 2
		str = newstr
	else:
		p += 1
print(count)
Problem p03208 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
tmp=input()
n = int(tmp.split(" ")[0])
k = int(tmp.split(" ")[1])
 
h=[]
 
for i in range(n):
    h.append(int(input()))
 
h.sort()
 
x=int(0)
y=int(h[k-1]-h[0])
 
for i in range(n-k+1):
    x=h[i+k-1]-h[i]
    if x < y:
        y=x
 
print(y)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
 
tmp=input()
n = int(tmp.split(" ")[0])
k = int(tmp.split(" ")[1])

h=[]

for i in range(n):
    h.append(int(input()))

h.sort()

x=int(0)
y=int(h[k-1]-h[0])

for i in range(k):
    x=h[i+k-1]-h[i]
    if x < y:
        y=x


print(y)
Problem p03127 (python)

Fixed submission:
import functools, fractions
n, a = input(), list(map(int, input().split()))
print(functools.reduce(fractions.gcd, a))

Buggy submission (verdict: Runtime Error):
import functools, math
n, a = input(), list(map(int, input().split()))
print(functools.reduce(math.gcd, a))
Problem p03307 (python)

Fixed submission:
a = input()
print(a if a % 2 == 0 else a * 2)

Buggy submission (verdict: Runtime Error):
a = input()
print(a if a % 2 == 0 else a * 2)
Problem p03426 (python)

Fixed submission:
H, W, D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))
Q = int(input())
LR = []
for i in range(Q):
    LR.append(list(map(int, input().split())))

d = [0 for i in range(H*W+1)]
sA = [0 for i in range(H*W+1)]

for i in range(len(A)):
        for j in range(len(A[i])):
            sA[A[i][j]] = [i, j]

for i in range(D+1, H*W+1):
    d[i] = d[i-D] + abs(sA[i][0]-sA[i-D][0]) + abs(sA[i][1]-sA[i-D][1])

for lr in LR:
    l, r = lr[0], lr[1]
    print(d[r] - d[l])

Buggy submission (verdict: Runtime Error):
H, W, D = list(map(int, input().split()))
A = []
for i in range(H):
    A.append(list(map(int, input().split())))
Q = int(input())
LR = []
for i in range(Q):
    LR.append(list(map(int, input().split())))

d = [0 for i in range(H*W)]
sA = [0 for i in range(H*W+1)]

for i in range(len(A)):
        for j in range(len(A[i])):
            sA[A[i][j]] = [i, j]

for i in range(D+1, H*W):
    d[i] = d[i-D] + abs(sA[i][0]-sA[i-D][0]) + abs(sA[i][1]-sA[i-D][1])

for lr in LR:
    l, r = lr[0], lr[1]
    print(d[r] - d[l])
Problem p03803 (python)

Fixed submission:
a,b = [int(x) for x in input().split()]
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if j.index(a) > j.index(b):
  print('Alice')
elif j.index(a) < j.index(b):
  print('Bob')
else:
  print('Draw')

Buggy submission (verdict: Runtime Error):
a,b = [int(x) for x in input().split()]
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if j.index(a) > j.rindex(b):
  print('Alice')
elif j.index(a) < j.index(b):
  print('Bob')
else:
  print('Draw')

Buggy submission (verdict: Runtime Error):
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b = [int(x) for x in input().split()]
if j.index(a) > j.rindex(b):
  print('Alice')
elif j.index(a) < j.index(b):
  print('Bob')
else:
  print('Draw')

Buggy submission (verdict: Runtime Error):
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b = [int(x) for x in input().split()]
if j.index(a) > j.rindex(b):
  print('Alice')
elif j.rindex(a) < j.rindex(b):
  print('Bob')
else:
  print('Draw')

Buggy submission (verdict: Runtime Error):
j = [2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b = [int(x) for x in input().split()]
if j.rindex(a) < j.rindex(b):
  print('Alice')
elif j.rindex(a) > j.rindex(b):
  print('Bob')
else:
  print('Draw')
Problem p03834 (python)

Fixed submission:
print(input().replace(',',' '))

Buggy submission (verdict: Runtime Error):
k,s = [int(x) for x in input().split()]
a = 0
n = 0
while a <= k:
  b = 0
  while b <= k:
    z = s-a-b
    if 0<=z and z <= k:
      n += 1
    b += 1
  a += 1
print(n)

Buggy submission (verdict: Runtime Error):
k,s = [int(x) for x in input().split()]
ans = 0
for x in range(k+1):
    for y in range(x, k+1):
        z = s - x - y
        if x <= y <= z <= k:
            ans += [ None, 1, 3, 6 ][ len(set([ x, y, z ])) ]

Buggy submission (verdict: Runtime Error):
k,s = input().split()
a = 0
n = 0
while a <= k:
  b = 0
  while b <= k:
    c = 0
    while c <= k:
      if (a+b+c) == s:
        n += 1
      c += 1
    b += 1
  a += 1
print(n)
Problem p03242 (python)

Fixed submission:
n = input()
dict = {"1" : "9", "9" : "1"}
ans = ""
for i in range(len(n)) :
    ans += dict[n[i]]
print(ans)

Buggy submission (verdict: Runtime Error):
 n = input()
 dict = {"1" : "9", "9" : "1"}
 ans = ""
for i in range(len(n)) :
    ans += dict[n[i]]
print(ans)
Problem p03221 (python)

Fixed submission:
N,M = map(int,input().split())
P=[]
for _ in range(M):
  p,y = map(int,input().split())
  P.append((p,y))
d = {}
for p,y in P:
  if p not in d:
    d[p]=[]
  d[p].append(y)
sd = {k:dict(zip(sorted(v),range(1,1+len(v))))
      for k,v in d.items()}
for p,y in P:
  print('%06d%06d' % (p, sd[p][y]))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
P=[map(int,input().split()) for _ in range(M)]
d = {}
for p,y in P:
  if p not in d:
    d[p]=[]
  d[p].append(y)
sd = {k:dict(zip(sorted(v),range(1,1+len(v))))
      for k,v in d.items()}
for p,y in P:
  print('%06d%06d' % (p, sd[p][y]))
Problem p03127 (python)

Fixed submission:
N = int(raw_input())
health = map(int, raw_input().strip().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

if len(health) == 1:
	print health[0]
else:
	g = gcd(health[0], health[1])
	for i in range(2, len(health)):
		g = gcd(g, health[i])
print g

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
health = map(int, raw_input().strip().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

if len(health) == 1:
	print(health[0])
else:
	g = gcd(health[0], health[1])
	for i in range(2, len(health)):
		g = gcd(g, health[i])
print(g)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
health = map(int, raw_input().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_driver(lst):
	if len(lst) <= 1:
		return lst[0]

	if len(lst) > 2:
		lst[1] = gcd(lst[0], lst[1])
		return gcd_driver(lst[1:])
	
	return gcd(lst[0], lst[1])

print(gcd_driver(health))

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
health = map(int, raw_input().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def gcd_driver(lst):
	if len(lst) <= 1:
		return lst[0]
	if len(lst) > 2:
		lst[1] = gcd(lst[0], lst[1])
		return gcd_driver(lst[1:])
	else:
		return gcd(lst[0], lst[1])

print gcd_driver(health)

Buggy submission (verdict: Runtime Error):
N = int(raw_input().split()[0])
health = map(int, raw_input().split())


def gcd(a, b):
	while b:
		a, b = b, a%b
	return a

def gcd_driver(lst):
	if len(lst) > 2:
		lst[1] = gcd(lst[0], lst[1])
		return gcd_driver(lst[1:])
	else:
		return gcd(lst[0], lst[1])

print gcd_driver(health)
Problem p03135 (python)

Fixed submission:
T, X = map(float, raw_input().strip().split())
print T/X

Buggy submission (verdict: Runtime Error):
T, X = map(int, raw_input().strip().split())
print '%.10d' % T*1./X
Problem p03135 (python)

Fixed submission:
a=input().split()
b=int(a[0])/int(a[1])
c=float(b)
print(round(c,5))

Buggy submission (verdict: Runtime Error):
a=int(input().split())
b=a[0]/a[1]
print(round(-5,b))

Buggy submission (verdict: Runtime Error):
a=int(input().split())
print(a[0]/a[1])
Problem p03252 (python)

Fixed submission:
s = input()
t = input()

start = [-1] * 26
goal = [-1] * 26
flag = True
length = len(s)
dict = { chr(97 + i):i for i in range(26) }
for i in range(0, length):
	a = dict[s[i]]
	b = dict[t[i]]

	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			flag = False
			break
	else:
		start[a] = b;
		goal[b] = a;
if flag:
	print("Yes")
else:
	print("No")

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

i = 0
his = []
length = len(s)
flag = True
for i in range(0, length-1):
	ss = s[i:i+1]
	tt = t[i:i+1]
	if ss != tt:
		if tt in his:
			flag = False
			break
		else:
			his.append(tt)
			it1 = re.finditer(ss, s)
			it2 = re.finditer(tt, s)
			for match in it1:
				s = s[:match.start()] + tt + s[match.end():]
			for match in it2:
				s = s[:match.start()] + ss + s[match.end():]

if flag:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
import re
import sys

s = input()
t = input()

i = 0
dic = {}
length = len(s)
for i in range(0, length-1):
	ss = s[i:i+1]
	tt = t[i:i+1]
	if ss != tt:
		if ss in dic or tt in dic:
			if dic[ss] != tt or dic[tt] != ss:
				print("No")
				sys.exit()
			else:
				it1 = re.finditer(ss, s)
				it2 = re.finditer(tt, s)
				for match in it1:
					s = s[:match.start()] + tt + s[:match.end()]
				for match in it2:
					s = s[:match.start()] + ss + s[:match.end()]
		else:
			dic[ss] = tt
			dic[tt] = ss
			it1 = re.finditer(ss, s)
			it2 = re.finditer(tt, s)
			for match in it1:
				s = s[:match.start()] + tt + s[:match.end()]
			for match in it2:
				s = s[:match.start()] + ss + s[:match.end()]

print("Yes")
Problem p03253 (python)

Fixed submission:
import math

def prime_factor2(n):
    i = 2
    factors = {}
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            if i in factors:
                factors[i] += 1
            else:
                factors[i] = 1
    if n > 1:
        if n in factors:
            factors[n] += 1
        else:
            factors[n] = 1
    return factors

def kai(n):
    return math.factorial(n)

def H(n, r):
    rtn = 1
    for i in range(n+r-1, n-1, -1):
        rtn *= i
    rtn //= kai(r)
    return rtn


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

prime = prime_factor2(M)

ans = 1
for v in prime.values():
    h = H(N, v) % (10**9 + 7)
    ans  =  ans * h

ans = ans % (10**9 + 7)
ans = int(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sympy

def kai(n):
    return math.factorial(n)

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

prime = sympy.factorint(M)

ans = 1
for v in prime.values():
    ans  =  ans * (kai(N+v-1)/(kai(v)*kai(N-1)))

ans = ans % (10**9 + 7)
ans = int(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sympy

def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def kai(n):
    return math.factorial(n)

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

prime = sympy.factorint(M)

ans = 1
for v in prime.values():
    ans  =  ans * (kai(N+v-1)/(kai(v)*kai(N-1)))

ans = ans % (10**9 + 7)
ans = int(ans)
print(ans)
Problem p03135 (python)

Fixed submission:
input_data = input().split()
input_int = list(map(int,input_data))
T = input_int[0]
X = input_int[1]

A = T / X
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
L_max = max(L)

L_sum = sum(L)

if L_sum - L_max > L_max:
    print("Yes")
else:
    print("No")
Problem p03803 (python)

Fixed submission:
import sys
[Alice, Bob] = sys.stdin.readline().split()
if Alice == Bob:
	print('Draw')
	sys.exit()
if Alice == '1':
	print('Alice')
	sys.exit()
if Bob == '1':
	print('Bob')
	sys.exit()
if int(Alice) < int(Bob):
	print('Bob')
else:
	print('Alice')

Buggy submission (verdict: Runtime Error):
import sys
[Alice, Bob] = sys.argv[1].split()
if Alice == Bob:
	print 'Draw'
	return 0
if Alice == '1':
	print 'Alice'
	return 0
if Bob == '1':
	print 'Bob'
	return 0
if int(Alice) < int(Bob):
	print 'Bob'
else:
	print 'Alice'
Problem p03135 (python)

Fixed submission:
T, X = list(map(int, input().split()))
print(T/X)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
X_list = sorted(list(map(int, input().split())))
result_list =[]
for i in range(M):
    result = 0
    for x in X_list:
        result += i ^ x
    result_list.append(result)
if len(result_list)==0:
    print(X_list[0])
else:
    print(max(result_list))
Problem p03127 (python)

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

while len(HPs) > 1:
    HPs.sort()
    for i in range(len(HPs)-1):
        HPs[i+1] = HPs[i+1] % HPs[0]
    while 0 in HPs:
        HPs.remove(0)

print(HPs[0])

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

print(N)
print(HPs)

while len(HPs) > 1:
    HPs.sort()
    for i in range(len(HPs)-1):
        HPs[i+1] = HPs[i+1] % HPs[0]
    if 0 in HPs: 
        HPs.remove(0)

print(HPs[0])

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

while len(HPs) > 1:
    HPs.sort()
    for i in range(len(HPs)-1):
        HPs[i+1] = HPs[i+1] % HPs[0]
    HPs.remove(0)

print(HPs[0])

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

while len(HPs) > 1:
    HPs.sort()
    for i in len(HPs):
        HPs[i+1] = HPs[i+1] % HPs[0]
    HPs.remove(0)

print(HPs[0])
Problem p03137 (python)

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

if N >= M:
    print(0)
else:
    distance = []
    X.sort()
    for i in range(M-1):
        distance.append(X[i+1]-X[i])
    distance.sort(reverse=True)
    print(sum(distance[N-1:]))

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

if N >= M:
    print(0)
else:
    distance = []
    X.sort()
    for i in range(M-1):
        distance = distance.append(X[i+1]-X[i])
    distance.sort(reverse=True)
    print(sum(distance[N:]))
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()

ans = 10 ** 9
for i in range(N-K+1):
    ans = min(ans, h[i+K-1]-h[i])

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = []
for _ in range(N):
    h.append(int(input()))

h.sort()

ans = 10 ** 9
for i in range(N-K+1):
    ans = min(ans, h[i+K]-h[i])

print(ans)