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

Fixed submission:
import math

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

ha = (M / 60 + H)*30
ma = M*6
ang = ha - ma

cosa =math.cos(ang*math.pi/180)

c = math.sqrt(A**2 + B**2 - 2 * A * B * cosa)


print(c)

Buggy submission (verdict: Runtime Error):
import math

A, B, H, M=map(int,input().split(""))

a = int(A)
b = int(B)
h = int(H)
m = int(M)
ang = 6*m - (30*h + 0.5*m)

cosa =math.cos(ang)

c = math.sqrt(a^2 + b^2 - 2 * a * b * cosa)


print(c)

Buggy submission (verdict: Runtime Error):
import math

A, B, H, M=map(int,input().split(" "))

a = int(A)
b = int(B)
h = int(H)
m = int(M)
ang = 6*m - (30*h + 0.5*m)

if ang > 0:
	ang = ang
else:
	ang = 360 - ang

cosa =math.cos(ang)

c = math.sqrt(a^2 + b^2 - 2 * a * b * cosa)


print(c)
Problem p02641 (python)

Fixed submission:
x,y=map(int,input().split())
a=list(map(int,input().split()))
a=set(a)
for i in range(101):
  
  if x-i not in a:
        print(x-i)
        exit()
  elif x+i not in a:
      print(x+i)
      exit()

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
a=list(map(int,input().split()))
a=set(a)
for i in range(101):
  
  if x-i not in a:
        print(x-i)
        exit()
    elif x+i not in a:
        print(x+i)
        exit()
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input())
print(a*b)
Problem p02675 (python)

Fixed submission:
n = input()
if n[-1:] == str(2) or  n[-1:] ==  str(4)  or  n[-1:] ==  str(5) or  n[-1:] == str(7) or  n[-1:] == str(9):
  print('hon')
if (n[-1:]) == str(0) or  n[-1:] == str(1) or  n[-1:] == str(6) or  n[-1:] == str(8):
  
  print('pon')
if (n[-1:]) == str(3):
  print('bon')

Buggy submission (verdict: Runtime Error):
n=(input())
rem=str(n)

if int(n[-1:]) in str(2) or str(4) or str(7) or str(9):
  print('hon')
if int(n[-1:]) in str(0) or str(1) or str(6) or str(8):
  print('bon')
if int(n[-1:]) == str(3):
  print('pon')

Buggy submission (verdict: Runtime Error):
n=int(input())
rem=str(n)
l1=[2,4,5,7,9]
l2=[0,1,6,8]

if int(n[-1:]) in l1:
  print('hon')
if int(n[-1:]) in l2:
  print('bon')
if int(n[-1:]) == 3:
  print('pon')
Problem p02681 (python)

Fixed submission:
string,string2=input(),input()
string2=string2[0:len(string2)-1]
print("Yes" if string==string2 else "No")

Buggy submission (verdict: Runtime Error):
string,string2=map(str,input().split())
string2=string2[0:len(string2)-1]
print("Yes" if string==string2 else "No")

Buggy submission (verdict: Runtime Error):
string,sub_string=map(str,input().split())
results = 0
sub_len = len(sub_string)
for i in range(len(string)):
  if string[i:i+sub_len] == sub_string:
    if len(sub_string)-len(string) ==1:
      print('Yes')
  else:
    print('No')
Problem p02719 (python)

Fixed submission:
n,m=map(int,input().split())
ans=0
n%=m
#print(n,m)
ans=min(n,(m-n))
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=0
n%=m
ans=(min(n,(m-n))
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=0
n%=m
ans=(min(n,(k-n))
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=0
n%=m
ans=(min(n,k-n))
print(ans)
Problem p02639 (python)

Fixed submission:
number = input().split()
for i in range(len(number)):
    if number[i]=="0":
        print(i+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_ = [int(i) for i in input().split()]
A=set(A_)
if len(_A)>len(A) and len(A)=0:
    print(0)
else:
    A.sort()
    A.reverse()
    times = 0
    for n,i in enumerate(A):
        flag = 0
        for j in list(range(n-1,n))+list(range(n+1,len(A))):
            if A[j]<=i:
                if i%A[j]==0:
                    flag = 1
                    break
        if flag == 0:            
            times+=1   
            
    print(times)
Problem p02641 (python)

Fixed submission:
X,N = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
nlist = [0 for i in range(105)] 
for i in p:
    nlist[i]=1
for i in range(max(X+1,100-X+1)):
    
    if X-i>=0:
        if nlist[X-i] == 0:
            result = X-i
            break
    if X+i<=101:
        if nlist[X+i] == 0:
            result = X+i
            break
print(result)

Buggy submission (verdict: Runtime Error):
X,N = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
nlist = [0 for i in range(100)] 
for i in p:
    nlist[i-1]=1
for i in range(max(X+1,100-X+1)):
    
    if X-i-1>=0:
        if nlist[X-i-1] == 0:
            result = X-i
            break
    if X+i-1<=99:
        if nlist[X+i-1] == 0:
            result = X+i
            break
print(result)

Buggy submission (verdict: Runtime Error):
X,N = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
nlist = [0 for i in range(100)] 
for i in p:
    nlist[i-1]=1
for i in range(max(X+1,100-X+1)):
    
    if X-i-1>=0:
        if nlist[X-i-1] == 0:
            result = X-i
            break
    if X+i-1>=0:
        if nlist[X+i-1] == 0:
            result = X+i
            break
print(result)

Buggy submission (verdict: Runtime Error):
X,N = [int(i) for i in input().split()]
p = [int(i) for i in input().split()]
nlist = [0 for i in range(100)] 
for i in p:
    nlist[i-1]=1
for i in range(max(X,100-X)):
    
    if X-i>=0:
        if nlist[X-i-1] == 0:
            result = X-i
            break
    if X-i>=0:
        if nlist[X+i-1] == 0:
            result = X+i
            break
print(result)
Problem p02645 (python)

Fixed submission:
name = input()
name = name[:3]
print(name)

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

A=[int(i) for i in input().split()]
if K > N or K>30:
    output=""
    for i in range(N):
         output+=(str(N)+" ")
    print(output)
else:
    for _ in range(K):
        A_next =[1 for i in range(N)]
        for i in range(N):
            for j in range(A[i]):
                if (i+j+1) < N:
                    A_next[i+j+1]+=1
                if (i-j-1) >= 0:
                    A_next[i-j-1]+=1
        A=A_next
    output=""
    for i in A_next:
        output+=(str(i)+" ")
    print(output)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
 
A=[int(i) for i in input().split()]
if K > N or K>30:
    output=""
    for i in range(N):
         output+=(str(N)+" ")
    print(output)
else:
    for _ in range(K):
        A_next =[1 for i in range(N)]
        for i in range(N):
            for j in range(A[i]):
                if (i+j+1) < N:
                    A_next[i+j+1]+=1
                if (i-j-1) >= 0:
                    A_next[i-j-1]+=1
        A=A_next
    output=""
    for i in A_next:
        output+=(str(i)+" ")
    print(output)
        
    
N,K=map(int,input().split())

A=[int(i) for i in input().split()]
if K > N or K>40:
    output=""
    for i in range(N):
         output+=(str(N)+" ")
    print(output)
else:
    for _ in range(K):
        A_next =[1 for i in range(N)]
        for i in range(N):
            for j in range(A[i]):
                if (i+j+1) < N:
                    A_next[i+j+1]+=1
                if (i-j-1) >= 0:
                    A_next[i-j-1]+=1
        A=A_next
    output=""
    for i in A_next:
        output+=(str(i)+" ")
    print(output)
Problem p02801 (python)

Fixed submission:
C = input()
H = [chr(i) for i in range(97,97+26)]
l = len(H)
for i in range(l):
    if (C==H[i]):
        ans=H[i+1]
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N,K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
max=0
min=0
for i in range(K-1,N):
    max+=A[i]*comb(i,K-1)

for i in range(N-K+1):
    min+=A[i]*comb(N-1-i,K-1)
ans=(max-min)%(10**9 +7)
print(ans)
Problem p02830 (python)

Fixed submission:
N = int(input())
H = list(map(str, input().split()))
S = H[0]
T = H[1]
#print(S)
#print(T)
L=S[0]+T[0]
for i in range(1,N):
    L=L+S[i]
    L=L+T[i]
print(L)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(str, input().split()))
S = H[0]
T = H[1]
#print(S)
#print(T)
L=S[0]+T[0]+S[1]+T[1]
#L[1]=T[1]
#L[2]=S[2]
#L[3]=T[2]


if N >=3:
    for i in range(2,N):
        L=L+S[i]
        L=L+T[i]
print(L)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(str, input().split()))
S = H[0]
T = H[1]
#print(S)
#print(T)
L=S[0]+T[0]+S[1]+T[1]
#L[1]=T[1]
#L[2]=S[2]
#L[3]=T[2]


if N >=3:
    for i in range(2,N):
        L=L+S[i]
    for i in range(2,N):
        L=L+T[i]
print(L)
Problem p02999 (python)

Fixed submission:
A,X= map(int, input().split())
if A<X:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while ((D<=X)and(i<(N))):
  D+=L[i]
  i+=1
print(i)

Buggy submission (verdict: Runtime Error):
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while ((D<=X)and(i!=N)):
  D+=L[i]
  i+=1
print(i)
Problem p03000 (python)

Fixed submission:
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while (D<=X)and(i<N+1):
  if (i<N):
    D+=L[i]
  i+=1
#  if i>N:
 #   break
print(i)

Buggy submission (verdict: Runtime Error):
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while (D<X):
  D+=L[i]
  i+=1
  if i>N:
    break
print(i)

Buggy submission (verdict: Runtime Error):
N,X = map(int, input().split())
D=0
L=list(map(int, input().split()))
i=0
while (D<=X):
  D+=L[i]
  i+=1
  if i>N:
    break
print(i)
Problem p03037 (python)

Fixed submission:
ss=input().split(" ")
N=int(ss[0])
M=int(ss[1])
x=1
y=N
for i in range(M):
  tt=input().split(" ")
  if int(tt[0])>x:
    x=int(tt[0])
  if int(tt[1])<y:
    y=int(tt[1])
last=int(y-x+1)
if last>0:
  print(last)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
ss=input().split(" ")
N=int(ss[0])
M=int(ss[1])
x=0
y=N
for i in range(M):
  tt=input().split(" ")
  if int(tt[0])>x:
    x=int(tt[0])
  if int(tt[1])<y:
    y=int(tt[1])
print(int(y-x+1)

Buggy submission (verdict: Runtime Error):
ss=input().split(" ")
N=int(ss[0])
M=int(ss[1])
x=0
y=N
for i in range(M):
  tt=input().split(" ")
  if int(tt[0])>x:
    x=int(tt[0])
  if int(tt[1])<y:
    y=int(tt[1])
print(int(y-x+1)
Problem p02705 (python)

Fixed submission:
import math
r=int(input())
print(r*2*math.pi)

Buggy submission (verdict: Runtime Error):
r=int(input())
print(r*2*math.pi)
Problem p02747 (python)

Fixed submission:
s=input()
n=len(s)
if s=="hi"*(n//2):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
 s=input()
n=len(s)
if s=="hi"*(n//2):
  print("Yes")
else:
  print("No")
Problem p02917 (python)

Fixed submission:
n=int(input())
b=list(map(int,input().split()))
b.append(b[-1])
a=[]
a.append(b[0])
for i in range(0,n-1):
  a.append(min(b[i],b[i+1]))
print(sum(a))

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

a.append(b[-1])
for i in range(1,n):
  if i<n-1:
    if b[-1-i]>=b[-i]:
      a.append(b[-i])
    else:
      a.append(b[-1-i])
  else:
    if b[1]>=b[0]:
      a.append(b[0])
    else:
      a.append(b[1])
print(sum(a))
Problem p02923 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
c=[0]
l=0
for i in range(n-1):
  if h[i]>=h[i+1]:
    
    c[l]+=1
  else:
    c.append(0)
    l+=1
print(max(c))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
c=[]
l=0
for i in range(n-1):
  if h[i]>=h[i+1]:
    c.append(0)
    c[l]+=1
  else:
    c.append(0)
    l+=1
print(max(c))
Problem p02999 (python)

Fixed submission:
X,A = map(int, input().split())
if X<A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
print((w*h)/2)
if (w==2*x and h!=2*y) or (w!=2*x and h==2*y) or (x==0 and y==0) or (x==w and y==0) or (x==0 and y==h) or (x==w and y==h) or (w/x==h/y and w!=2*x) or (h/y==w/(w-x) and w-x==h and w!=2*x):
  print(0)
else:
  print(1)
Problem p03079 (python)

Fixed submission:
A,B,C = map(int, input().split())
if A==B and B==C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if A=B and B=C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if A=B=C:
  print('Yes')
else:
  print('No')
Problem p03369 (python)

Fixed submission:
S = input()
count = 0
List = [s for s in S]
for i in List:
  if i == "o":
    count+=1
print(700+100*count)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
List = [s for s in S]
for i in List:
  if i = "o":
    count+=1
print(700+100*count)
Problem p02658 (python)

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

	if 0 in  A:
		print(0)
		return

	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return

	print(prod)

main ()

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
	print(0)
	return
prod = 1
for a in A:
	prod *= a
	if prod > 1000000000000000000:
		print(-1)
		return
print(prod)
Problem p02639 (python)

Fixed submission:
a,b,c,d,e=list(map(int,input().split()))
if(a==0):
  print(1)
elif(b==0):
  print(2)
elif(c==0):
  print(3)
elif(d==0):
  print(4)
else:
  print(5)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e=int(input(),split())
if(a==0):
  print(1)
elif(b==0):
  print(2)
elif(c==0):
  print(3)
elif(d==0):
  print(4)
else:
  print(5)
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*calc
    if(ans>1000000000000000000):
        print(-1)
        exit()
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*a[i]
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)
Problem p02658 (python)

Fixed submission:
n=int(input())
a=input().split()
a=list(map(int,a))
ans=1
if(0 in a):
    print(0)
    exit()

for calc in a:
    ans*=calc
    if(ans>10**18):
        print(-1)
        exit()
if(ans>10**18):
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*ch
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    if(0 in a==True):
        print(0)
        exit()
    ans=ans*calc[i]
    i+=1
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
a=list(map(int,a))
i=0
ans=1
for calc in a:
    ans=ans*a[i]
    i+=1
    if(ans>1000000000000000000):
        if(0 in a==false):
            print(-1)
            exit()
        else:
            print(0)
            exit()
    if(i==n):
        break
if(ans>1000000000000000000):
    print(-1)
else:
    print(ans)
Problem p02663 (python)

Fixed submission:
h1, m1, h2, m2, k = map(int, input().split())
##勉強できる時間
h = 60*(h2 - h1)
m = m2-m1
time = h + m - k
print(time)

Buggy submission (verdict: Runtime Error):
h1,m1,h2,m2,k = map(int(input()))

a = 60(h2-h1)
b = m2-m1
##起きている合計時間
c = a+b
##勉強開始時間の最遅時間
d = c-k
print(d)
Problem p02641 (python)

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

if N == 0:
  print(X)
else:
  p_list = sorted(p_list)
  all_range = list(range(102))
  A = [i for i in all_range if i not in p_list]
  B = [abs(i - X) for i in A]

  low = X - min(B)
  high = X + min(B)

  output = 0
  if high > 101:
    output = low
  if low < 0:
    output = high

  if output != 0:
    print(output)
  elif high in p_list:
    print(low)
  elif low in p_list:
    print(high)
  else:
    print(low)

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

p_list = sorted(p_list)
all_range = list(range(1, 101))
A = [i for i in all_range if i not in p_list]
B = [abs(i - X) for i in A]

low = X - min(B)
high = X + min(B)

output = 0
if high > 100:
  output = low
if low < 1:
  output = high

if N == 0:
  print(X)
elif output != 0:
  print(output)
elif high in p_list:
  print(low)
elif low in p_list:
  print(high)
else:
  print(low)

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

p_list = sorted(p_list)
all_range = list(range(1, 101))
A = [i for i in all_range if i not in p_list]
B = [abs(i - X) for i in A]

low = X - min(B)
high = X + min(B)

output = 0
if high > 100:
  output = low
if low < 1:
  output = high

if N == 0:
  print(X)
elif output != 0:
  print(output)
elif high in p_list:
  print(low)
elif low in p_list:
  print(high)

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

p_list = sorted(p_list)
all_range = list(range(1, 101))
A = [i for i in all_range if i not in p_list]
B = [abs(i - X) for i in A]

low = X - min(B)
high = X + min(B)

if N == 0:
  print(X)
elif high in p_list:
  print(low)
else:
  print(high)
Problem p02696 (python)

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

x = min(B-1, N)
y = math.floor(A*x/B) - A * math.floor(x/B)
print(y)

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

x = list(range(1, N+1))

ans = -10**20
for i in x:
  y = math.floor(A*i/B) - A * math.floor(i/B)
  if y > ans:
    ans = y
print(y)

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

x = list(range(1, N+1))

ans = -10**20
for i in x:
  y = math.floor(A*i/B) - A * math.floor(i/B)
  if y > ans:
    ans = y
  elif y < ans:
    break
print(y)

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

x = list(range(1, N+1))

ans = -10**10
for i in x:
  y = math.floor(A*i/B) - A * math.floor(i/B)
  if y > ans:
    ans = y
  elif y < ans:
    break
print(y)

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

x = list(range(1, N+1))

ans = -10**10
for i in x:
  y = math.floor(A*i/B) - A * math.floor(i/B)
  if y > ans:
    ans = y
  elif y < ans:
    break
print(y)
Problem p02705 (python)

Fixed submission:
import math

R = int(input())
output = 2* R * math.pi

print(output)

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

for i in range(1, N+1):
  print(A.count(i))
Problem p02995 (python)

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

gcd = fractions.gcd(C, D)
lcm = C * D // gcd
a_c = (A-1) // C
a_d = (A-1) // D
b_c = B // C
b_d = B // D
a_lcm = (A-1) // lcm
b_lcm = B // lcm
count = (B - A + 1) - ((b_c - a_c) + (b_d - a_d) - (b_lcm - a_lcm))
print(int(count))

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

def gcd(C, D):
  if C >= D:
    tmp = C
    C = D
    D = tmp
  gcd = 1  
  for i in range(D-C+1):
    dif_1 = D % C
    if C % dif_1 == 0:
      gcd = dif_1
      break
    D = C
    C = dif_1
  return gcd

gcd = gcd(C, D)
lcm = C * D // gcd
a_c = (A-1) // C
a_d = (A-1) // D
b_c = B // C
b_d = B // D
a_lcm = (A-1) // lcm
b_lcm = B // lcm
count = (B - A + 1) - ((b_c - a_c) + (b_d - a_d) - (b_lcm - a_lcm))
print(int(count))

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

def gcd(C, D):
  if C >= D:
    tmp = C
    C = D
    D = tmp
  gcd = 1  
  for i in range(D-C+1):
    dif_1 = D % C
    if C % dif_1 == 0:
      gcd = C
      break
    D = C
    C = dif_1
  return gcd

gcd = gcd(C, D)
lcm = C * D // gcd
a_c = (A-1) // C
a_d = (A-1) // D
b_c = B // C
b_d = B // D
a_lcm = (A-1) // lcm
b_lcm = B // lcm
count = (B - A + 1) - ((b_c - a_c) + (b_d - a_d) - (b_lcm - a_lcm))
print(int(count))

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

def gcd(C, D):
  if C >= D:
    tmp = C
    C = D
    D = tmp
  gcd = 1  
  for i in range(D-C+1):
    dif_1 = D % C
    if C % dif_1 == 0:
      gcd = dif_1
      break
    D = C
    C = dif_1
  return gcd

gcd = gcd(C, D)
lcm = C * D // gcd
a_c = (A-1) // C
a_d = (A-1) // D
b_c = B // C
b_d = B // D
a_lcm = (A-1) // lcm
b_lcm = B // lcm
count = (B - A + 1) - ((b_c - a_c) + (b_d - a_d) - (b_lcm - a_lcm))
print(int(count))
Problem p02621 (python)

Fixed submission:
a = int(input())

print(a+(a**2) + (a**3))

Buggy submission (verdict: Runtime Error):
a - int(input())

print(a+a**2+a**3)
Problem p02641 (python)

Fixed submission:
X, num = [int(i) for i in input().split(" ")]

 
if num == 0:
  print(X)
else:
  l = [int(i) for i in input().split(" ")]
  for i in range(num):
    if X-i not in l:
      print(X-i)
      exit()
    elif X+i not in l:
      print(X+i)
      exit()
  print(X-num)

Buggy submission (verdict: Runtime Error):
X, num = [int(i) for i in input().split(" ")]
l = [int(i) for i in input().split(" ")]
 
if num == 0:
  print(X)
else:
  for i in range(num):
    if X-i not in l:
      print(X-i)
      exit()
    elif X+i not in l:
      print(X+i)
      exit()
  print(X-num)

Buggy submission (verdict: Runtime Error):
X, num = [int(i) for i in input().split(" ")]
l = [int(i) for i in input().split(" ")]

if num == 0:
  print(X)
else:
  for i in range(num):
    if X-i not in l:
      print(X-i):
      exit()
    elif X+i not in l:
      print(X+i)
      exit()
  print(X-num)
Problem p02772 (python)

Fixed submission:
num = int(input())
l = [int(i) for i in input().split(" ")]
 
deny = False
 
for ele in l:
  if ele%2==0:
    if ele%3!=0 and ele%5!=0:
      print("DENIED")
      deny = True
      break;
 
if not deny:
  print("APPROVED")

Buggy submission (verdict: Runtime Error):
num = int(input())
l = [int(i) for i in input().split(" ")]

deny = False

for ele in l:
  if ele%2==0:
    if ele%3!=0 and ele%5!=0:
      print("DENIED")
      deny = True
      break;

if !deny:
  print("APPROVED)
Problem p02783 (python)

Fixed submission:
H, A = input().split(" ")
H = int(H)
A = int(A)
print((H+A-1)//A)

Buggy submission (verdict: Runtime Error):
H, A = input().split(" ")
H = int(H)
A = int(A)
return (H+A-1)//A

Buggy submission (verdict: Runtime Error):
H, A = input().split(" ")
return (H+A-1)//A

Buggy submission (verdict: Runtime Error):
H, A = input().split(" ")
print((H+A-1)//A)

Buggy submission (verdict: Runtime Error):
H, A = input()
num = (H + (A-1))//A
print(num)
Problem p02784 (python)

Fixed submission:
H, N = input().split(" ")
A = list(map(int, input().split()))
if sum(A) < int(H):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = input().split(" ")
A = list(map(int, input().split()))
if sum(A) < H:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = input().split(" ")
A = input()
A = [int(a) for a in A]
if sum(A) < H:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = input().split(" ")
A = input()
if sum(A) < H:
  print("No")
else:
  print("Yes")