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

Fixed submission:
X,N=map(int,input().split() )
if( (N==0)):
  print(X)

else:
  p = list(map(int,input().split() ))

  p.sort()
  q=list(range(-5,102))

  for i in p:
    q.remove(i)

  Z=1000
  for i in q:
    if( abs(X-i)<Z):
      Z=abs(X-i)
      ans=i
  
  print(ans)

Buggy submission (verdict: Runtime Error):
X,N=map(int,input().split() )
if(N==0 || N==100):
  print(X)

else:
  p = list(map(int,input().split() ))

  p.sort()
  q=list(range(1,max(p)+1))

  for i in p:
    q.remove(i)

  Z=1000
  ans=-1
  for i in q:
    if( abs(X-i)<Z):
      Z=abs(X-i)
      ans=i
  
  print(ans)
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,K = map(int,input().split() )

H=h2-h1
M=m2-m1

if(M<0):
  M += 60
  H -= 1
if(H<0):
  H += 24

M += H*60

ans =M - K
print(ans)

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

H=h2-h1
M=m2-m1

if(M<0):
  m += 60
  H -= 1
if(H<0):
  H += 24

M += H*60

ans =M - K
print(ans)
Problem p02534 (python)

Fixed submission:
print("ACL"*(int(input())))

Buggy submission (verdict: Runtime Error):
print("ACL"*(int(input()))
Problem p02582 (python)

Fixed submission:
s=input()
cnt=0
if s=="SSS":
    cnt=0
elif s=="RRR":
    cnt=3
elif s=="RRS" or s=="SRR":
    cnt=2
else:cnt=1
print(cnt)

Buggy submission (verdict: Runtime Error):
s=input()
if s=="RRR":
    print(3)
elif s="RR":
    print(2)
elif s="R":
    print(1)
else: print(0)
Problem p02602 (python)

Fixed submission:
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
for i in lst_2:
    if i>1:
        print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k+1):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
print(lst_2)
for i in range(len(lst_2)-1):
    if lst_2[i]<lst_2[i+1]:
        print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k+1):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
for i in range(len(lst_2)-1):
    if lst_2[i]<lst_2[i+1]:
        print("Yes")
    else:print("No")
Problem p02646 (python)

Fixed submission:
def main():
    a,v=map(int,input().split())
    b,w=map(int,input().split())
    t=int(input())
    distance=abs(a-b) if a>=b else abs(b-a)
    ve=v-w
    if ve<=0:
        print("NO")
        return
    if distance<=ve*t:
        print("YES")
        return
    else:
        print ( "NO" )
        return



main()

Buggy submission (verdict: Runtime Error):
def main():
    a,v=map(int,input().split())
    b,w=map(int,input().split())
    t=int(input())
    distance=abs(a-b) if a>=b else abs(b-a)
    ve=v-w
    if ve<=0:
        print("NO")
        return
    if distance<=ve*t:
        print("YES")
        return
    else:
   		print("NO")
        return




main()
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
import math
print(math.pi*input()*2)
Problem p02783 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
print(-(-a/b))
Problem p02812 (python)

Fixed submission:
n=int(input())
l=input()
cnt=0
if n<=2:
  print(0)
  exit()
for i in range(n-2):
  if l[i:i+3]=="ABC":
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
 n=int(input())
l=input()
cnt=0
for i in range(n-3):
  if l[i:i+3]=="ABC":
    cnt+=1
print(cnt)
Problem p02817 (python)

Fixed submission:
print("".join(reversed(input().split())))

Buggy submission (verdict: Runtime Error):
print(input()+input())
Problem p02818 (python)

Fixed submission:
a,b,n=map(int,input().split())  
print(max(a-n,0),max(b-max(n-a,0),0))

Buggy submission (verdict: Runtime Error):
a,b,n=map(int(input().split()))
print(max(a-n,0),max(b-max(a-n,0),0))

Buggy submission (verdict: Runtime Error):
a,b,n=map(int(input()split()))
print(max(a-n,0),max(b-max(a-n,0),0))
Problem p02841 (python)

Fixed submission:
a,b=map(int,input().split())
c,d=map(int,input().split())
print([0,1][a==c-1])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c,d=map(int,input().split())
print([0,1][a==b+1]
Problem p02853 (python)

Fixed submission:
a,b=map(int,input().split())
lst={0:0,1:300000,2:200000,3:100000}
if a>3:
    x=0
else:
    x=a
if b>3:
    y=0
else:
    y=b
if x==1 and y==1:
    ans=1000000
else :
    ans=lst[x]+lst[y]


print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
lst={0:0,1:300000,2:200000,3:100000}
if a>4:
    x=0
else:
    x=a
if b>4:
    y=0
else:
    y=b
if x==1 and y==1:
    ans=1000000
else :
    ans=lst[x]+lst[y]


print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
lst={0:0,1:300000,2:200000,3:1000000}
if a>4:
    x=0
else:
    x=a
if b>4:
    y=0
else:
    y=b
if x==1 and y==1:
    ans=1000000
else :
    ans=lst[x]+lst[y]


print(ans)
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
print(a-2*b if a-2*b>0 else 0)

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

Fixed submission:
n,b=map(int,input().split())
l=list(map(int,input().split()))
cnt=0
for i in l:
  if i>=b:cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,b=map(int(input().split()))
l=list(map(int,input().split()))
cnt=0
for i in l:
  if i>=b:cnt+=1
print(cnt)
Problem p02899 (python)

Fixed submission:
n=int(input()) 
l=list(map(int,input().split())) 
dic_l={} 
lst_1=[] 
for i in range(n): 
	dic_l[l[i]]=i 
for j in range(1,n+1):
	lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))

Buggy submission (verdict: Runtime Error):
n=int(input()) 
l=list(map(int,input().split())) 
dic_l={} 
lst_1=[] 
for i in range(n): 
	dic_l[l[i]]=i 
	for j in range(1,n+1):
		lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))

Buggy submission (verdict: Runtime Error):
n=int(input()) 
l=list(map(int,input().split())) 
dic_l={} 
lst_1=[] 
for i in range(n): 
  dic_l[l[i]]=i 
  for j in range(1,n+1): 
    lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))

Buggy submission (verdict: Runtime Error):
n=int(input()) 
l=list(map(int,input().split())) 
	dic_l={} 
	lst_1=[] 
	for i in range(n): 
		dic_l[l[i]]=i 
	for j in range(1,n+1): 
		lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))

Buggy submission (verdict: Runtime Error):
n=int(input()) 
l=list(map(int,input().split())) 
	dic_l={} 
	lst_1=[] 
	for i in range(n): 
		dic_l[l[i]]=i 
		for j in range(1,n+1): 
			lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))
Problem p02921 (python)

Fixed submission:
i=input()
j=input()
count_num=0
for k in range(3):
  if i[k]==j[k]:
    count_num+=1
print(count_num)

Buggy submission (verdict: Runtime Error):
i=input()
j=input()
count_num=0
for k in range(3):
  if i[k]==j[k]:
    count_num+=1
print(conut_num)
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
for i in range(21):
	if b<= a*i-(i-1):
		print(i)
		break

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in range(2,21):
	if b<= a*i-(i+1):
		print(i)
        break

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in range(2,21):
	if b=< a*i-(i+1):
		print(i)
Problem p02923 (python)

Fixed submission:
n=int(input())
lst=list(map(int,input().split()))
ans=0
cnt=0
for i in range(len(lst)-1):
    if lst[i]>=lst[i+1]:
        cnt+=1
    else:
        cnt=0
    ans=max(cnt,ans)
print(ans)

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

cnt=0
for i in range(len(lst)-1):
    if lst[i]>=lst[i+1]:
        cnt+=1
    else:
        cnt=0
    ans=max(cnt,ans)
print(ans)

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

ans=[]
for i in range(len(lst)-1):
    cnt=0
    for j in range(i,len(lst)-1):
        if lst[j]>=lst[j+1]:
            cnt+=1
        else:
            break
    ans.append(cnt)
    
print(max(ans))
Problem p02934 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
sum_m=0
for i in l:
	sum_m+=1/i
print(1/sum_m)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split())
sum_m=0
for i in l:
	sum_m+=1/i
print(1/sum_m)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(input().split())
sum_m=0
for i in l:
	sum_m+=1/i
print(1/sum_m)
Problem p02958 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
m=sorted(l)
cnt=0
for i in range(n):
  if l[i]!=m[i]:
    cnt+=1
  if cnt>=3:
    print("NO")
    break
else:print("YES")

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int(input().split())))
m=sorted(l)
cnt=0
for i in range(n):
  if l[i]!=m[i]:
    cnt+=1
  if cnt>=3:
    print("NO")
else:print("YES")
Problem p02971 (python)

Fixed submission:
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
		print(k[-1])
	if i==k[-1]:
		print(k[-2])

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
    	print(k[-1])
	if i==k[-1]:
		print(k[-2])
Problem p02993 (python)

Fixed submission:
a=list(input())
for i in range(len(a)-1):
	if a[i]==a[i+1]:
		print("Bad")
		break
else:print("Good")

Buggy submission (verdict: Runtime Error):
a=list(input())
for i in range(len(a)-1):
	if a[i]==a[i+1]:
		print("Good")
        break
else:print("Bad")
Problem p02994 (python)

Fixed submission:
n , l = map ( int , input ( ).split ( ) ) 
lst = [i + l - 1 for i in range ( 1 , n + 1 )]
ans=1000000 
sum1=sum(lst) 
for i in lst: 
	if abs(i)<abs(ans): 
		ans=i
print(sum1-ans)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
lst_kazu=[i for i in range(1,n+1)]
lst_aji=[i-l+1 for i in range(1,n+1)]
lst_aji_sum=sum(lst_aji)
aji_ans=0
for i in range(n):
	if lst_aji[i]==int(lst_aji_sum/n):
    	aji_ans=(lst_aji_sum-lst_aji[i])
        break
    else:
      	aji_ans=min(aji_ans,abs(lst_aji[i]-(lst_aji_sum-lst_aji[i])/n))
print(aji_ans)

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
lst_kazu=[i for i in range(1,n+1)]
lst_aji=[i-l+1 for i in range(1,n+1)]
lst_aji_sum=sum(lst_aji)
aji_ans=0
for i in range(n):
	if lst_aji[i]==int(lst_aji_sum/n):
    	print(lst_aji_sum-lst_aji[i])
        break
    else:
      	aji_ans=min(aji_ans,ans(lst_aji[i]-int(lst_aji_sum/n)))
print(aji_ans)
Problem p03047 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print(a-b+1)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
A , B, T =map,int,(input().split())
print((T // A)*B)
Problem p03071 (python)

Fixed submission:
x,y=map(int,input().split())
if x!=y:
  print(max(x,y)*2-1)
else:
  print(x*2)

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
print(max(max(x,y)*2-1,x*2)
Problem p03076 (python)

Fixed submission:
l=[int(input()) for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)

Buggy submission (verdict: Runtime Error):
l=[input() for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)
Problem p03086 (python)

Fixed submission:
s=input()
ans=0
cnt=0
for i in s:
    if i in ["A","G","C","T"]:
        cnt+=1
        ans=max(ans,cnt)
    else: cnt=0
print(ans)

Buggy submission (verdict: Runtime Error):
n= input()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(ans,temp)
print(ans)
Problem p03106 (python)

Fixed submission:
a,b,c=map(int,input().split())
lst=[]
for i in range(1,101):
  if a %i==0 and b % i ==0:
    lst.append(i)
print(sorted(lst,reverse=True)[c-1])

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
using namespace std;

int main(){
    int a,b,c;
    const int CO=100;
    vector<int> vb;

    cin>>a>>b>>c;
    for (int i=1;i<CO+1;i++){
        if (a %i==0 && b % i==0){
        vb.push_back(i);
        }
    }
    reverse(vb.begin(),vb.end());
    cout<<vb[c-1]<<endl;
    return 0;
}
Problem p03136 (python)

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

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
#include <numeric>
using namespace std;

int main(){
    int n;
    int max_s=0;
    int sum_s=0;
    int L;

    cin>>n;
    for (int i=0;i<n;i++){
        cin>>L;
        sum_s+=L;
        max_s=max(max_s,L);
    }  	
	if (max_s<sum_s-max_s){
    cout<<"Yes"<<endl;
    }else{
    cout<<"No"<<endl;
    }
    return 0;
}

Buggy submission (verdict: Runtime Error):
n=int(input())
l=sort(map(int,input().split()))
print(["No","Yes"][l[-1]>=sum(l)-l[-1]])
Problem p03145 (python)

Fixed submission:
x,y,_=map(int,input().split())
print(x*y//2)

Buggy submission (verdict: Runtime Error):
x,y,_=map(int(input().split()))
print(x*y//2)
Problem p03160 (python)

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

def hantei(n,aaa):
	dp = [0]*(n+1)
	dp[0] = 0
	dp[1] = abs(aaa[1]-aaa[0])
	for i in range(n-2):
		dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
	return dp[n-1]

print(hantei(n,aaa))

Buggy submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP[-1])

Buggy submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP=[float("INF")]*H
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP,DP[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int,input().split()))
def hantei(n,aaa):
    dp = [0]*(n+1)
    dp[0] = 0
    dp[1] = abs(aaa[1]-aaa[0])
    for i in range(n-2):
        dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
    return dp[n-1]
hantei(n)
Problem p03161 (python)

Fixed submission:
import sys
input = sys.stdin.readline
H, K = map(int, input().split())
lst_0=list(map(int,input().split()))
DP=[float("INF")]*H
DP[0]=0
for i in range(1,H):
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=min(DP[i],abs(lst_0[i]-lst_0[i-j])+DP[i-j])
print(DP[H-1])

Buggy submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP[-1])

Buggy submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP[-1])
Problem p03210 (python)

Fixed submission:
n=int(input())
print(["NO","YES"][n==7 or n==5 or n==3])

Buggy submission (verdict: Runtime Error):
n=int(input())
print(["NO","YES"][n==7 or n==5 orn==3])
Problem p03211 (python)

Fixed submission:
n=input()
a=0
b=753
ans=100000000
for i in range(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
	ans=min(abs(a-b),ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
a=0
b=753
ans=100000000
for i in renge(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
	ans=min(abs(a-b),ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
a=0
b=753
ans=100000000
for i in renge(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
    ans=min(abs(a-b),ans)
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 p03251 (python)

Fixed submission:
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
	if x1<i<=x2:
		print("No War")
		break
else:
	print("War")

Buggy submission (verdict: Runtime Error):
3 2 10 20
8 15 13
16 22
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
	if x1<i<=x2:
  		print("No War")
        break
	else:print("War")
print(n,m,x,y,x1,x2)
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
ans=False
for i in range(1,4):
  if a*b*i %2 ==1: 
    ans=True
    break    
if ans:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=false
for i in range(1,4):
  if a*b*c %2 ==1: 
    ans=True
    break    
if ans;print("Yes")
else:print("No")
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

def gcd(*numbers):
  return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
  return reduce(math.gcd, numbers)

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))
Problem p03281 (python)

Fixed submission:
def I(): return int(input())
n = I()
ans = 0
if n>=105:
    for i in range(105,n+1,2):
        cnt=0
        for j in range(1,int(i**0.5)+1):
            if i % j ==0:
                if j*j==i:
                    cnt+=1
                else:
                    cnt+=2
        if cnt==8:
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
#include <cmath>
#include<string>
#define REP(i,n) for(int i=0;i<int (n);i++)
using namespace std;

int main(){
    int n;
    int ans=1;
    cin>>n;
    if (n<105){
        cout<<0<<endl;
        return 0;
    }
    for (int i=106;i<=n;i++){
        int cnt=0;
        for (int j=1;j<=i;j++){
            
            if (i %j ==0){
                cnt++;
            } 
        }
        if (cnt==8) ans++;
    }
    cout<<ans<<endl; 
    
    return 0;
}

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(n**0.5)+1
con_num=0
for i in range(m):
  if n%i==0:
    con_num+=1
if con_num==8 and n%2==1:
  print("1")
else:
  print("0")
Problem p03325 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
dd=[]                                                                  
for i in l: 
	if i % 2==0:
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst))

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()) 
dd=[]                                                                  
for i in l: 
	if i % 2==0: 
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst))
Problem p03359 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=b:print(a)
else: print(a-1)

Buggy submission (verdict: Runtime Error):
a,b=mac(int,input().split())
if a<=b:print(a)
else: print(a-1)
Problem p03360 (python)

Fixed submission:
a,b,c=map(int,input().split())
k=int(input())
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))

Buggy submission (verdict: Runtime Error):
a,b,=map(int,input().split()) 
k=int(input()) 
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
print((max(a,b,c))*2*k+sum(a,b,c))
Problem p03386 (python)

Fixed submission:
a,b,c=map(int,input().split()) 
l=list(range(a,b+1)[0:c]) 
m=list(range(b,a-1,-1)[0:c]) 
ans=sorted(set(l+m)) 
print(*ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sorted(set(l+m))
print(*ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sort(set(l+m))
print(*ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sort(set(l+M))
print(ans)
Problem p03407 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print("Yes"a+b>=c else"No")
Problem p03424 (python)

Fixed submission:
i=open(0).read().split()[1:]
print(["Three","Four"]["Y" in i])

Buggy submission (verdict: Runtime Error):
i=open(0).read().split()[1:]
print(["Three","Four"][if "Y" in i])
Problem p03434 (python)

Fixed submission:
n=input() 
l=sorted(map(int,input().split()),reverse=True)
print(sum(l[::2])-sum(l[1::2]))

Buggy submission (verdict: Runtime Error):
l=sorted(map(int,input().split()))
print(l[::2]-l[1::2])
Problem p03447 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input()) #500円
b = int(input()) #100円
c = int(input()) #50円
x = int(input())
 
count = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if x == 500 * i + 100 * j + 50 * k:
        count += 1
print(count)