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

Fixed submission:
a,b,c = map(int,input().split('/'))
if a > 2019 or a == 2019 and b >= 5:
    print('TBD')
else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
s = input()
if s[6] >= 5:
    print('TBD')
else:
    print('Heisei')
Problem p03145 (python)

Fixed submission:
a,b,c = map(int,input().split())
print(a * b // 2)

Buggy submission (verdict: Runtime Error):
a,b,c =map(int.input().split())
print(a * b // 2)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
if n == 1:
    print('Hello World')
else:
    print(a + b)
Problem p03288 (python)

Fixed submission:
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
R = int(input())
if R < 1200:
    print('ABC')
elif <2800:
    print('ARC')
else:
    print('AGC')
Problem p03385 (python)

Fixed submission:
s = input()
if s.count('a') == 1 and s.count('b') == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
for a in s and b in s and c in s:
    print('Yes')
else:
    print('No')
Problem p03434 (python)

Fixed submission:
#coding=utf-8
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
Alice = A[::2]
Bob = A[1::2]
print(sum(Alice) - sum(Bob))

Buggy submission (verdict: Runtime Error):
# coding=utf-8
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)  
alice=a[::2]　　
bob=a[1::2]　　　
print(sum(alice)-sum(bob))
Problem p03605 (python)

Fixed submission:
n = input()
if n[0] == '9' or n[1] == '9':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = input()
for 9 in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = input()
if 9 in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if 9 in n:
    print('Yes')
else:
    print('No')
Problem p03693 (python)

Fixed submission:
r,g,b = map(int,input().split())
n = r*100 + g*10 + b
if n % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(int,input().split())
n == r*100 + g*10 + b
if n % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(int,input().split())
n == r*100 + g*10 + b
if n % 4 = 0:
    print('YES')
else:
    print('NO')
Problem p03711 (python)

Fixed submission:
x,y = map(int,input().split())
a =[4,6,9,11]
b = [1,3,5,7,8,10,12]
if (x in a and y in a) or (x in b and y in b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a,b ==[4,6,9,11]:
    print('Yes')
elif a,b ==[1,3,5,7,8,10,12]:
    print('Yes')
else:
    print('No')
Problem p03777 (python)

Fixed submission:
a,b = map(str,input().split())
if a == 'D' and b == 'D':
    print('H')
elif a == 'H' and b == 'H':
    print('H')
else:
    print('D')

Buggy submission (verdict: Runtime Error):
a,b = map(str,input().split())
if a == D and b == D:
    print('H')
elif a == H and b == H:
    print('H')
else:
    print('D')

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if a == D and b == D:
    print('H')
elif a == H and b == H:
    print('H')
else:
    print('D')

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0] == D and a[1] == D:
    print('H')
elif a[0] == H and a[1] == H:
    print('H')
else:
    print('D')

Buggy submission (verdict: Runtime Error):
a = input().split()
if a[0] == D and a[1] == D:
    print(H)
elif a[0] == H and a[1] == H:
    print(H)
else:
    print(D)
Problem p03844 (python)

Fixed submission:
n = input().split()
if n[1] == '+':
    print(int(n[0])+int(n[2]))
else:
    print(int(n[0])-int(n[2]))

Buggy submission (verdict: Runtime Error):
n = input().split()
if n[1] == '+':
    print(int(n[0]+n[2]))
else:
    print(int(n[0]-n[2]))

Buggy submission (verdict: Runtime Error):
n = input().split()
if n[2] == '+':
    print(int(n[0]+n[4]))
else:
    print(int(n[0]-n[4]))

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
if b == +:
    print(int(a + c))
else:
    print(int(a - c))
Problem p03845 (python)

Fixed submission:
N = int(input())
T = list(map(int,input().split()))
M = int(input())
all = sum(T)
for i in range(M):
   P,X = list(map(int,input().split()))
   print(all - T[P-1] + X)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P,X = [list(map(int,input().split())) for _ in range(M)]
all = sum(T)
print(all - T[P-1] + X)
Problem p03852 (python)

Fixed submission:
c = input()
d =['a', 'e', 'i', 'o', 'u']

if c in d:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
c = input()
if c == a:
    print('vowel')
elif c == e:
    print('vowel')
elif c == i:
    print('vowel')
elif c == o:
    print('vowel')
elif c == u:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
c = input()
if c = a:
    print('vowel')
elif c = e:
    print('vowel')
elif c = i:
    print('vowel')
elif c = o:
    print('vowel')
elif c = u:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
c = input('')
if c == a:
    print('vowel')
elif c == e:
    print('vowel')
elif c == i:
    print('vowel')
elif c == o:
    print('vowel')
elif c == u:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
c = input('')
if c = a:
    print('vowel')
elif c = e:
    print('vowel')
elif c = i:
    print('vowel')
elif c = o:
    print('vowel')
elif c = u:
    print('vowel')
else:
    print('consonant')
Problem p04043 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a==5 and b==5 and c==7:
    print('YES')
elif a==5 and b==7 and c==5:
    print('YES')
elif a==7 and b==5 and c==5:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a=5 and b=5 and c=7:
    print('YES')
elif a=5 and b=7 and c=5:
    print('YES')
elif a=7 and b=5 and c=5:
    print('YES')
else:
    print('NO')
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m = map(int,input().split())
ans = 0
ang = 0
tan = 30*h+0.5*m
cho = 6*m
ang = abs(cho-tan)
#print(tan,cho,ang)

ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(ang)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m = map(int,input().split())
ans = 0
ang = 0

if 6*m == 30*h+0.5*m:
  ans = 1
elif abs(6*m - 30*h+0.5*m) == 180:
  ans = 7
  ang = 180
elif 6*m > 30*h+0.5*m:
  ang = 6*m - 30*h+0.5*m
  ans = sqrt(a**2+b**2-2*a*b*math.cos(ang))
else:
  ang = 30*h+0.5*m + (360 - 6*m)
  if ang > 360:
    ang -= 360
  ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(ang)))
print(ans)
Problem p02741 (python)

Fixed submission:
n = int(input())
l = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
print(l[n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
l = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
print(l[n+1])
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
cnt = 0
for i,j in s,t:
  if i == j:
    cnt += 1
print(cnt)
Problem p02934 (python)

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

sum = 0

for i in range(n):
  sum += 1/l[i]
print(1/sum)

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

sum = 0

for i in range(i):
  sum += 1/l[i]
print(1/sum)
Problem p03071 (python)

Fixed submission:
a, b = map(int,input().split())
ma = max(2*a-1, a+b, 2*b-1)
print(ma)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input())
ma = max(2*a-1, a+b, 2*b-1)
print(ma)
Problem p03106 (python)

Fixed submission:
a,b,c = map(int,input().split())
cnt = 0
ans = 0

s = min(a,b)
for i in range(s,0,-1):
#  print("i:" + str(i))
  if a%i == 0 and b%i == 0:
    cnt += 1
    if cnt == c:
      ans = i
      break
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
cnt = 0
for i in range(min(a,b),-1):
  if a%i == 0 and b%i == 0:
    cnt += 1
    if cnt == c:
      break
print(i)
Problem p03136 (python)

Fixed submission:
n = int(input())
l = sorted(list(map(int, input().split())))
if l[-1] * 2 < sum(l):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = sprted(list(map(int, input().split())))
if l[-1] * 2 < sum(l):
  print("Yes")
else:
  print("No")
Problem p03206 (python)

Fixed submission:
n = int(input())
s = "Christmas"

a = 25 - n
s += " Eve" * a

print(s)

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

a = 25 - n
  s += " Eve" * a

print(s)
Problem p03211 (python)

Fixed submission:
s = input()
ans = 1000
n = 0
for i in range(0,len(s)-2):
  n = int(s[i] + s[i+1] + s[i+2])
  ans = min(ans,abs(n-753))
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 1000
n = 0
for i in range(0:len(s)-2):
  n = int(s[i] + s[i+1] + s[i+2])
  ans = min(ans,abs(n-753))
print(ans)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
n = int(input)
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
Problem p03316 (python)

Fixed submission:
a = input()
s = list(a)
n = 0

for i in s:
  n += int(i)

print("Yes" if int(a)%n == 0 else "No")

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

for i in s:
  n += int(s)

print("Yes" if int(s)%n == 0 else "No")
Problem p03477 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print("Left" if a+b>c+d else "Right" if a+b<c+d else "Balanced
")
Problem p03485 (python)

Fixed submission:
import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
dic = {}
count = 0

for i in range(n):
  dic.setdefault(l[i],0)
  dic[l[i]] += 1
#print(dic)
for x,y in dic.items():
  if x <= y:
    count += y - x
  else:
    count += y
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
L = list(set(l))
count = 0
for x in L:
  if l.count(x) == x:
    continue
  elif l.count(x) > x:
    count += l.count(x) - x
  else:
    count += l.count(x)
print(count)
Problem p03545 (python)

Fixed submission:
a,b,c,d= map(int,input())
if a+b+c+d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b+c-d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a+b-c+d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a-b+c+d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
elif a-b+c-d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a-b-c+d==7:
  print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
else:
  print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')

Buggy submission (verdict: Runtime Error):
a,b,c,d= map(int,input().split())
if a+b+c+d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b+c-d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a+b-c+d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a-b+c+d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
elif a-b+c-d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a-b-c+d==7:
  print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
else:
  print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')

Buggy submission (verdict: Runtime Error):
a,b,c,d= map(int,input().split())
if a+b+c+d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif  a+b+c-d==7:
  print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif  a+b-c+d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif  a-b+c+d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif  a+b-c-d==7:
  print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
elif  a-b+c-d==7:
  print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif  a-b-c+d==7:
  print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
else:
  print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
Problem p03563 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(2*c-a)
Problem p03694 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
print(max(l) - min(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = map(int,input().split())
print(max(l) - min(l))
Problem p03844 (python)

Fixed submission:
a,b,c = map(str,input().split())
if b == "+":
  print(int(a) + int(c))
else:
  print(int(a )- int(c))

Buggy submission (verdict: Runtime Error):
a,b,c = map(str,input().split())
if b == "+":
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
Problem p03845 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
m = int(input())
sum = sum(l)
copy = sum

for i in range(m):
  sum = copy
  a,b = map(int,input().split())
  sum += b - l[a-1]
  print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input()))
m = int(input())
sum = sum(l)
copy = sum

for i in range(m):
  sum = copy
  a,b = map(int,input().split())
  sum += b - l[a-1]
  print(sum)
Problem p03860 (python)

Fixed submission:
a,b,c = input().split()
print("A" +b[0]+ "C")

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline

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

ans = b//c - a//c
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
count = 0
for i in range(a,b+1):
  if i % c == 0:
    count += 1
print(count)
Problem p04043 (python)

Fixed submission:
num= input().split()
count5 = 0
count7 = 0
 
for i in range(len(num)):
    if num[i] == '5':
        count5 += 1
    elif num[i] == '7':
        count7 += 1
    else:
        continue
if count5 == 2 and count7 == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
str = input()
count5 = str.count(5)
count7 = str.count(7)
if count5 == 2 and count7 == 1:
  print('Yes')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
num = input().split()

str = input()
strc = ''
for i in range(int(num[0])-1):
  strc = input()
  if str > strc:
    str = strc + str
  else:
    str = str + strc
print(str)

Buggy submission (verdict: Runtime Error):
num= input().split()
5count = 0
7count = 0
 
for i in range(len(num)):
  if num[i] == '5':
    5count += 1
  elif num[i] == '7':
    7count += 1
if 5count == 2 and 7count == 1:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
num= int(input().split())
5count = 0
7count = 0

for i in range(len(num)):
  if num[i] == 5:
    5count += 1
  elif num[i] == 7:
    7count += 1
if 5count == 2 and 7count == 1:
  print('YES')
else:
  print('NO')
Problem p04044 (python)

Fixed submission:
num = input().split()
str = [input()]
strc = ''
flg = 0
res = ''
for i in range(int(num[0])-1):
#	print(1)
	strc = input()
	for j in range(len(str)):
		if str[j] < strc:
#			print(2)
			flg = 0
		else:
#			print(3)
			flg = j
			break
		j += 1
	flg = -1
	if flg == 0:
		str.append(strc)
	else:
		str.insert(j,strc)
#	print(str)
for x in str:
	res += x
print(res)

Buggy submission (verdict: Runtime Error):
num = int(input().split())

str = input()
strc = ''
for i in range(num[0]-1):
  strc = input()
  if str > strc:
    str = strc + str
  else:
    str = str + strc
print(str)

Buggy submission (verdict: Runtime Error):
num = int(input().split())

str = ''
strc = ''
for i in range(num[0]-1):
  strc = input()
  if str > strc:
    str = strc + str
  else:
    str = str + strc
print(str)

Buggy submission (verdict: Runtime Error):
num = int(input().split())
str = ''
strc = ''
for i in range(num[0]):
  strc = input()
  if str > strc:
    str = strc + str
  else:
    str = str + strc
print(str)
Problem p02778 (python)

Fixed submission:
s=input()
y=len(s)
print("x"*y)

Buggy submission (verdict: Runtime Error):
s=input()
y=lens(s)
print("x"*y)
Problem p02811 (python)

Fixed submission:
k,x=map(int,input().split())
print("Yes" if 500*k>=x else "No" )

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
print("Yes" if 500*k>=x "No" else)
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif b>=(k-a):
  print(0,b-k+a)
else:
  print(0,0)
Problem p02658 (python)

Fixed submission:
import numpy as np
from decimal import *
 
n = int(input())
a = list(map(Decimal, input().split()))
b = np.array(a)
temp = 1
 
if a.count(0) >0:
  print(0)
  exit()
 
for i in range(n):
  temp = b[i] * temp
  if temp > 10**18 or temp < 0:
    print('-1')
    exit()
 
print(temp)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
import numpy as np
N=Decimal(input())
L=list(map(Decimal,input().split()))
L=Decimal(np.prod(L, dtype=Decimal))

if L>=1000000000000000001:
  print("-1")
else:
  print(int(L))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
import numpy as np
N=Decimal(input())
L=list(map(Decimal,input().split()))
L=Decimal(np.prod(L))

if L>=1000000000000000001:
  print("-1")
else:
  print(int(L))
Problem p02630 (python)

Fixed submission:
n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
    actions.append(input().split())
 
dict={}
for e in elements:
    count=dict.get(e,0)
    count+=1
    dict[e]=count
 
sum=0
for key in dict.keys():
    sum+=int(key)* dict[key]

for act in actions:
    count=dict.get(act[0],0)
    sum+=(int(act[1])-int(act[0]))*count
    count+=dict.get(act[1],0)
    dict[act[1]]=count
    dict[act[0]]=0
 
    print(str(sum))

Buggy submission (verdict: Runtime Error):
n=int(input())
elements= input().split()
q=int(input())
actions=[]
for i in range(q):
    actions.append(input().split())
 
dict={}
for e in elements:
    count=dict.get(e,0)
    count+=1
    dict[e]=count
 
sum=0
for key in dict.keys():
    sum+=int(key)* dict[key]

for act in actions:
    count=dict.get(act[0],0)
    sum+=(int(act[1])-int(act[0]))*count
    count+=dict.get(act[1],0)
    dict[act[1]]=count
    del dict[act[0]]
 
    print(str(sum))
Problem p02675 (python)

Fixed submission:
N = input()


if int(N[len(N)-1]) in [2 , 4 , 5 ,7 , 9]:
    print("hon")
elif int(N[len(N)-1]) in [0,1,6,8]:
    print("pon")
else:
    print("bon")

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

import math

degreeA = (H * 60 + M) / 2
degreeB = M * 6

if degreeA == degreeB:
    print(abs(A - B))
else:
    degreeAB = abs(degreeA - degreeB)
    if degreeAB == 180:
        print(A + B)
    elif degreeAB > 180:
        degreeAB = 360 - degreeAB
    C = A ** 2 + B ** 2 - 2 * A * B * math.cos(degreeAB * math.pi / 180)
    print(math.sqrt(C))

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

import math
print(math.pi)

degreeA = (H * 60 + M) / 2
degreeB = M * 6

if degreeA == degreeB:
    print(abs(A - B))
else: #degreeA > degreeB:
    degreeAB = abs(degreeA - degreeB)
    if degreeAB == 180:
        print(A + B)
    elif degreeAB > 180:
        degreeAB = 360 - degreeAB
    C = A ** 2 + B ** 2 - 2 * A * B * math.cos(degreeAB * math.pi / 180)
    print(math.sqrt(C))
Problem p02677 (python)

Fixed submission:
A,B,H,M = map(float, input().split())

import math

degreeA = float((H * 60 + M) / 2)
degreeB = float(M * 6)

degreeAB = abs(degreeA - degreeB)

if degreeAB > 180:
    degreeAB = 360 - degreeAB
C = float(A ** 2 + B ** 2 - 2 * A * B * float(math.cos(float(degreeAB * math.pi / 180))))
print(math.sqrt(C))

Buggy submission (verdict: Runtime Error):
A,B,H,M = map(float, input().split())

import math

degreeA = float((H * 60 + M) / 2)
degreeB = float(M * 6)

#if degreeA == degreeB:
#    print(abs(A - B))
else:
    degreeAB = abs(degreeA - degreeB)
    if degreeAB == 180:
        print(A + B)
    elif degreeAB > 180:
        degreeAB = 360 - degreeAB
    C = float(A ** 2 + B ** 2 - 2 * A * B * float(math.cos(float(degreeAB * math.pi / 180))))
    print(math.sqrt(C))

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

import math
print(math.pi)

degreeA = (H * 60 + M) / 2
degreeB = M * 6

if degreeA == degreeB:
    print(abs(A - B))
else:
    degreeAB = abs(degreeA - degreeB)
    if degreeAB == 180:
        print(A + B)
    elif degreeAB > 180:
        degreeAB = 360 - degreeAB
    C = A ** 2 + B ** 2 - 2 * A * B * math.cos(degreeAB * math.pi / 180)
    print(math.sqrt(C))
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
A = "Yes"

for i in range(len(S)):
    if S[i] != T[i]:
        A = "No"
        break
        
    
print(A)

Buggy submission (verdict: Runtime Error):
def intlist(x):
    y = []
    for i in range(len(x)):
        y.append(int(x[i]))
    return y
 
N, M, X = map(int, input().split())
price = -1
 
L = []
a = []
 
suit =[]
for i in range(M+1):
    a.append(0)

 
for i in range(N):
    text = input().split()
    L.append(intlist(text))
 
def buy(x,y):
    
    if x + y <= N:
        
        for i in range(0,M+1):
            
            a[i] += L[x+y-1][i]
            
        
        if x + y == N:
            score = a[1:len(a)]
            
            if min(score) >= X:
                suit.append(a.copy())
                
        elif x + y != N:
            buy(x+1,y)
            for i in range(0,M+1):
                a[i] -= L[x+y][i]
            
            notbuy(x,y+1)
 
 
def notbuy(x,y):
    print("notbuy",x,y)
    if x + y <= N:
        
        if x + y == N:
            score = a[1:len(a)]
            if min(score) >= X:
                suit.append(a.copy())
                    
                
        elif x + y != N:
            buy(x+1,y)
            for i in range(0,M+1):
                a[i] -= L[x+y][i]
            notbuy(x,y+1)    
 
def textbook(x,y):
    buy(x+1,y)
    for i in range(0,M+1):
        a[i] -= L[x+y][i]
    notbuy(x,y+1)
 
textbook(0,0)
 
b = []
 
if suit != []:
    for i in range(len(suit)):
        for j in range(len(suit)-1):
            if suit[j] > suit[j+1]:
                b = suit[j]
                suit[j] = suit[j+1]
                suit[j+1] = b
    price = suit[0][0]
 
 
print(price)
Problem p02641 (python)

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

tmp = 1000
result = []
result2 = []
for i in range(0, 102):
    if i in A:
        continue

    hoge = abs(X - i)
    if hoge <= tmp:
        tmp = hoge
        result2.append(tmp)
        result.append(i)

result3 = []
for i, v in enumerate(result2):
    if v == min(result2):
        result3.append(result[i])

print(min(result3))

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

tmp = 1000
result = []
result2 = []
for i in range(1, 101):
    if i in A:
        continue

    hoge = abs(X - i)
    if hoge <= tmp:
        tmp = hoge
        result2.append(tmp)
        result.append(i)

result3 = []
for i, v in enumerate(result2):
    if v == min(result2):
        result3.append(result[i])

print(min(result3))