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

Fixed submission:
import heapq as hq
n,m=map(int,input().split())
a=[-int(x) for x in input().split()]
hq.heapify(a)
for i in range(m):
    x=hq.heappop(a)
    x=-x//2
    hq.heappush(a,-x)
 
print(sum(a)*-1)

Buggy submission (verdict: Runtime Error):
import math
n,m=int(input().split())
a=list(map(int,inpit().split()))
ans=0

for i in range(m):
  a=sorted(a,reverse=True)
  a[0]=math.floor(a[0]/2)
     
for j in range(n):
  ans+=a[j]
    
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int(input().split()))
a=list(map(int,inpit().split()))
ans=0

for i in range(m):
  a=sorted(a,reverse=True)
  a[0]=math.floor(a[0]/2)
     
for j in range(n):
  ans+=a[j]
    
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int(input().split()))
a=list(map(int,inpit().split()))
ans=0

for i in range(m):
    a=sorted(a,reverse=True)
    a[0]=math.floor(a[0]/2)
     
for j in range(n):
    ans+=a[j]
    
print(ans)
Problem p02915 (python)

Fixed submission:
n=int(input())
print(n**3)

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

for i in range(1,n-1):
  a[i]=min(b[i-1],b[i])

print(sum(a))
Problem p02951 (python)

Fixed submission:
A, B, C = map(int, input().split())
if C-A+B>=0:
  print(C-A+B)
else:
  print("0")

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
ans=0
for i in range(0,n-1):
  if h[i]<=h[i+1]:
    ans+=0
  elif h[i]>=h[i+1]+2:
    ans+=1
  else:
    if i<(n-2):
      if h[i+1]<=h[i+2]:
        ans+=0
      else:
        ans+=1    
    else:
      if h[i]>h[i-1]:
        ans+=0
      else:
        ans+=1
        
if ans==0:
    print("Yes")
else:
    print("No")
Problem p02959 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(input().split()))
b=list(map(input().split()))
cnt=0
for i in range(0,n-2):
  if b[i]>=b[i+1]:
    if b[i]<=a[i+1]:
      cnt+=b[i]
      a[i+1]-=b[i]
    else:
      cnt+=a[i+1]
      cnt+=min(a[i],(b[i]-a[i+1]))
  else:
    if b[i]<=a[i]:
      cnt+=b[i]
    else:
      cnt+=a[i]
      a[i+1]-=b[i]-a[i]
      
cnt+=min(a[n],b[n-1])  

print(cnt)
Problem p02970 (python)

Fixed submission:
n,d=map(int,input().split())
a=(2*d)+1
if n%a==0:
  print(int(n/a))
else:
  print((n//a)+1)

Buggy submission (verdict: Runtime Error):
n,d=map(int,inout().split())
a=2*d+1
print((n//a)+1)
Problem p02989 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
m=int(n/2)
d=sorted(d)
print(d[m]-d[m-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
m=int(n/2)
d=sorted(d)
print(d[m+1]-d[m])

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
m=n/2
d.sort()
print(d[m+1]-d[m])

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
m=n/2
li=sorted(d)
print((li[m+1]-li[m]))

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
m=n/2
d=sorted(d)
print(d[m+1]-d[m])

Buggy submission (verdict: Runtime Error):
n=int(input())
d=map(int,input().split())
m=n/2
d=sorted(d)
print(d[m+1]-d[m])
Problem p03011 (python)

Fixed submission:
p,q,r=map(int,input().split())
a=p+q
b=p+r
c=q+r
print(min(a,b,c))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[0]=1
MOD=(10**9)+7

a.append(int(input()) for i in range(m))
  
if 1 not in a:
  b[1]=1
else:
  b[1]=0
  
for j in range(2,n+1):
  if j in a:
    continue
  else:
    b[j]=(b[j-1]+b[j-2])%MOD
    
print(b[n]%MOD)
Problem p03013 (python)

Fixed submission:
n,m=map(int,input().split())
mod=10**9+7
a=[0]*(n+1)
dp=[0]*(n+1)
dp[0]=1
for i in range(m):
    a[int(input())]=1
    
if a[1]==1:
    dp[1]=0
else:
    dp[1]=1
    
for j in range(2,n+1):
    if a[j]==0:
        dp[j]=dp[j-1]+dp[j-2] 
                  
print(dp[n]%mod)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[1]=1
b[0]=1
MOD=(10**9)+7

a.append(int(input()),for _ in range(m))
  
if 1 in a:
  b[1]=0
else:
  b[1]=1
  
for j in range(2,n+1):
  if j not in a:
    b[j]=(b[j-1]+b[j-2])%MOD
    
print(b[n]%MOD)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[1]=1
b[2]=2

for i in range(0,m):
  a.append(int(input()))
  
if 1 in a:
  b[1]=0
  if 2 in a:
    b[2]=0
  else:
    b[2]=1
  
for j in range(3,n+1):
  if j in a:
    continue
  else:
    b[j]=b[j-1]+b[j-2]
    
print(b[n]%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[0]=0
b[1]=1
b[2]=2

for i in range(0,m):
  a.append(int(input()))
  
if 1 in a:
  b[1]=0
  if 2 in a:
    b[2]=0
  else:
    b[2]=1
  
for j in range(3,n+1):
  if j in a:
    b[j]=0
  else:
    b[j]=b[j-1]+b[j-2]
    
print(b[n]%(10**9+7))
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])

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

s[k-1]=s[k-1].lower()

print(s)
Problem p03042 (python)

Fixed submission:
s=input()
a=int(s[0]+s[1])
b=int(s[2]+s[3])

if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a==0 and b>=1 and b<=12:
  print("YYMM")  
elif a>=1 and a<=12 and b>=13:
  print("MMYY")
elif a>=1 and a<=12 and b==0:
  print("MMYY")
elif a>=1 and a<=12 and b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
s=input()
a=int(s[:2])
b=int(s[2:])

if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a==0 and b>=1 and b<=12:
  print("YYMM")  
elif a>=1 and a<=12 and b>=13:
  print("MMYY")
elif a>=1 and a<=12 and b==0:
  print("MMYY")
elif a>=1 and a<=12 b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
s=input()
a=int(s[:2])
b=int(s[2:])
if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a>=1 and a<=12 and (b==0 or b>=13):
  print("MMYY")
elif a>=1 and a<=12 b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")
Problem p03127 (python)

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

while len(a)>=2:
  for i in range(1,len(a)):
    a[i]=a[i]%a[0]
  if 0 in a:
    for j in range(a.count(0)):
      a.remove(0)
  a.sort()
    

print(a[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
def gcd(x,y):
  if x%y==0:
    return y
  else:
    return(y,x%y)
  
x=a[0]
  
for i in range(1,n):
  x=gcd(x,a[i])
  
print(x)

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

while len(a)>=2:
  for i in range(1,len(a)):
    a[i]=a[i]%a[0]
  if 0 in a:
    a.remove(0)
  a.sort()
    

print(a[0])
Problem p03252 (python)

Fixed submission:
S=str(input())
T=str(input())
x=[]
y=[]
dic={}

for i in range(len(S)):
    x.append(S[i])
    y.append(T[i])
    
for s,t in zip(x,y):
    if s in dic:
        if dic[s]!=t:
            print("No")
            exit()
    else:
        dic[s]=t

if len(dic)!=len(set(dic.values())):
    print("No")   
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S=str(input())
T=str(input())
dic={}
for s,t in zip(S,T):
    if s in dic:
        if dic[s]!=t:
            print("No")
            exit()
    else:
        dic[s]=t

if len(d)!=len(set(d.values())):
    print("No")   
else:
    print("Yes")
Problem p02682 (python)

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

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

Fixed submission:
n=input()
if n[0]==n[1] and n[1]==n[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
=input()
if S=="BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S=input()
if S=+"BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
ans=input()
n=int(input())
for i in range(n):
  t=input()
  if t=="1":
    ans=ans[::-1]
  else:
    if t[2]=="1":
      ans=t[4]+ans
    else:
      ans=ans+t[4]
print(ans)
Problem p02785 (python)

Fixed submission:
n,k=map(int,input().split())
life=sorted(list(map(int,input().split())),reverse=True)
if n<k:
  print(0)
else:
  ans=sum(life[k:])
  print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
life=sorted(list(map(int,input().split())))
if n<k:
  print(0)
else
  ans=sum(life[k:])
  print(ans)
Problem p02659 (python)

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

a = int(a)
b = int(float(b)*1000)

print(int((a * b) // 1000))

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
ib = 0
for i in range(len(b)):
  ib += int(b[len(b)-i-1]) * 10**i

c = int(a*ib/100)

print(c)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
a = int(a)
ib = 0
for i in range(len(b)):
  ib += int(b[len(b)-i-1]) * 10**i

c = int(a*b/100)

print(c)
Problem p02916 (python)

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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]-1]

print(ful)

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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]]

print(ful)

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

ful = sum(B)

for i in range(N-1):
  if (A[i+1]-A[i]) == 1:
    ful += C[A[i]]

print(ful)
Problem p02989 (python)

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

sd = sorted(d)
low = sd[N//2-1]
up = sd[N//2]
num = up - low
print(num)

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

sd = sorted(d)
low = sd[N/2-1]
up = sd[N/2]
num = up - low
print(num)
Problem p02990 (python)

Fixed submission:
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    if N-K+1-i >= 0:
        ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K+1) // (math.factorial(N-K+1-i)*math.factorial(i)))
        tans = int(ans % (10**9+7))
        print(tans)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K+1) // (math.factorial(N-K+1-i)*math.factorial(i)))
    tans = ans % (10**9+7)
    print(tans)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (int(math.factorial(K-1)) // int((math.factorial(K-1-i+1)*math.factorial(i-1)))) * (int(math.factorial(N-K+1)) // int((math.factorial(N-K-i)*math.factorial(i))))
    tans = int(ans % int(math.pow(10,9)+7))
    print(tans)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K+1) // (math.factorial(N-K-i)*math.factorial(i)))
    tans = ans % (10**9+7)
    print(tans)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K+1) // (math.factorial(N-K-i)*math.factorial(i)))
    tans = int(ans % (10**9+7))
    print(tans)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())
for i in range(1,K+1):
    ans = (math.factorial(K-1) // (math.factorial(K-1-i+1)*math.factorial(i-1))) * (math.factorial(N-K) // (math.factorial(N-K-i)*math.factorial(i)))
    tans = int(ans % (10**9+7))
    print(tans)
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int,input().split())
answer = 0
if K <= A:
    print(K)
    K = 0
elif K > A:
    answer = A
    K = K - A
if K <= B and K > 0 :
    print(answer)
    K = 0
elif K > B:
    K = K - B
if K <= C and K > 0:
    answer = answer - K
    print(answer)

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
answer = 0
if K <= A:
    print(K)
elif K > A:
    answer = A
    K = K - A
if K <= B , K > 0 :
    print(answer)
elif K > B:
    K = K - B
if K <= C,K > 0:
    answer = answer - K
    print(answer)
Problem p02759 (python)

Fixed submission:
n = int(input())

if n % 2 > 0 :
  print(n // 2 + 1)
else:
  print(n // 2)

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

if n % 2 >  :
  print(n // 2 + 1)
else:
  print(n // 2)
Problem p02790 (python)

Fixed submission:
a, b = map(int,input().split())
x = ''
if a > b :
    for i in range(a):
        x =  x + str(b)
    print(x)
else:
    for i in range(b):
        x =  x + str(a)
    print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
#n = 5
#p = [4,2,5,1,3]
maxcnt = 1
cnt = 1
for i in range(n):
    box = 0
    cnt = 1
    box = p[i]
    if n - i < maxcnt :
        break

    for j in range(i + 1 , n ):
        if i < j and box >= p[j]:
            box = p[j]
            cnt += 1
            if maxcnt < cnt :
                maxcnt = cnt
            
print(maxcnt)
Problem p02711 (python)

Fixed submission:
N = str(input())

list = [N[0], N[1], N[2]]
if "7" in list:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = std(input())

a = N.split()

if 7 in a:
  print("Yes")
else:
  print("No")
Problem p02712 (python)

Fixed submission:
N = int(input())

a = 0

for val in range(1, N+1):
  if val%3 != 0 and val%5 != 0:
    a += val
  
print(a)

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

a = 0

for val in range(1, N+1):
  if val%3 != 0 and val%3 != 0:
    a += val
  
print(a)

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

a = 0

for val in range(1, N+1):
  if val%3 != 0 and val%3 != 0:
    a += val
  else:
    pass
  
print(a)
Problem p02881 (python)

Fixed submission:
N = int(input())
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a = make_divisors(N)
if len(a)%2 == 1:
  print(2*int(math.sqrt(N))-2)
if len(a)%2 == 0:
  b = a[int(len(a)/2)-1]
  c = a[int(len(a)/2)]
  print(b+c-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a = make_divisors(N)
if len(a)%2 == 1:
  print(2*int(math.sqrt(N))-2)
if len(a)%2 == 0:
  b = a[int(len(a))/2-1]
  c = a[int(len(a))/2]
  print(b+c-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a = make_divisors(N)
if len(a)%2 == 1:
  print(2*int(math.sqrt(N))-2)
else:
  b = a[len(a)/2-1]
  c = a[len(a)/2]
  print(b+c-2)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a>=3200:
  print(s)
else:
  print("red")

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
if a≥=3200:
  print(s)
else:
  print("red")
Problem p02987 (python)

Fixed submission:
S = input()
a = S[0]
b = S[1]
c = S[2]
d = S[3]
l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
k = list(set(l))
if len(k) == 2:
  if l.count(a) == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
a = S[0]
b = S[1]
c = S[2]
d = S[3]
l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
k = list(set(l))
if len(k) == 2:
  if count(a) == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
a = S[0]
b = S[1]
c = S[2]
d = S[3]
l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
k = set(l)
if len(k) == 2:
  if count(a) == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02989 (python)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N//2-1]
b = d[N//2]
if a != b:
  print(b-a)
if a == b:
  print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N/2-1]
b = d[N/2]
if a != b:
  print(b-a)
if a == b:
  print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int,input().split()))
d.sort()
a = d[N/2-1]
b = d[N/2]
print(b-a)
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1,N):
  if H[i]>=max(H[:i]):
    ans += 1
print(ans)

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

cnt = 0
for i in range(len(H)):
    if (max(H[0:i]) <= H[i]):
        cnt += 1

print(cnt)

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

cnt = 0
for i in range(len(H)):
    if (max(H[0:i]) == H[i]):
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1,N+1):
  if H[i]>=max(H[:i]):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split())
ans = 1
for i in range(1,N):
  if H[i]>=max(H[:i]):
    ans += 1
print(ans)

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

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)
Problem p02793 (python)

Fixed submission:
import fractions
N=int(input())
a = list(map(int, input().split()))

#------------最小公倍数---------------------
lcm = a[0]
for i in range(1, N):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
#------------------------------------------
ans=0
for j in a:
    ans += lcm // j
print(ans % 1000000007)

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

#------------最小公倍数---------------------
lcm = a[0]
for i in range(1, N):
    lcm = lcm * a[i] // math.gcd(lcm, a[i])
#------------------------------------------
ans =0


for j in a:
    ans += lcm // j
ans %= 1000000007
print(ans)

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

#------------最小公倍数---------------------
lcm = a[0]
for i in range(1, N):
    lcm = lcm * a[i] // math.gcd(lcm, a[i])
#------------------------------------------
b= []
for i in range(N):
    b.append(lcm //a[i])
ans=0


for j in range(len(b)):
    ans +=b[j]%1000000007



print(ans)

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

#------------最小公倍数---------------------
lcm = a[0]
for i in range(1, N):
    lcm = lcm * a[i] // math.gcd(lcm, a[i])
#------------------------------------------
b= []
for i in range(N):
    b.append(lcm //a[i])
ans=0


for j in range(len(b)):
    ans +=b[j]

ans%=1000000007

print(ans)

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

#------------最小公倍数---------------------
lcm = 1
for i in range(1, N):
    lmc = lcm * a[i] // fractions.lcm(lcm, a[i])
#------------------------------------------
b= []
for i in range(N):
    b.append(lcm //a[i])
ans=0

for j in b:
    ans +=(lcm// b[j])%1000000007


print(ans)

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

#------------最小公倍数---------------------
lcm = 1
for i in range(1, N):
    lmc = lcm * a[i] // fractions.lcm(lcm, a[i])
#------------------------------------------
b= []
for i in range(N):
    b.append(lcm //a[i])
ans=0

for j in b:
    ans +=(lcm// b)%1000000007


print(ans)

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

#------------最小公倍数---------------------
lcm = 1
for i in range(1, N):
    lmc = lcm * a[i] // fractions.lcm(lcm, a[i])
#------------------------------------------
b= []
for i in range(N):
    b.append(lcm //a[i])
ans=0

for j in b:
    ans +=lcm// b
    ans%=1000000007


print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
N=int(input())
a = list(map(int, input().split()))
gcd = a[0]
for i in range(1, N):
    gcd = gcd * a[i] // fractions.gcd(gcd, a[i])

b= []
for i in range(N):
    b.append(gcd //a[i])
ans=0

if N%2==0:
    for i in range(0,N,2):
	    ans = (b[i]+b[i-1])%1000000007
else:
        b.append(0)
	for i in range(0,N,2):
		ans = (b[i]+b[i-1])%1000000007


print(ans)
Problem p02693 (python)

Fixed submission:
k = int(input()) 
a,b= map(int,input().split())
ans = "NG"
L = []
for l in range(1,1001):
    if l%k == 0:
        L.append(l)
for j in range(a,b+1):
    if j in L:
        ans="OK"
print(ans)

Buggy submission (verdict: Runtime Error):
k = int(input()) 
a,b= map(int,input().split())
ans = "NG"
L = [i in i for range(1,1001) if i%k==0]
for j in range(a,b+1):
    if j in L:
        ans="OK"
print(ans)
Problem p02753 (python)

Fixed submission:
S = input()

if S=="AAA" or S=="BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
if S="AAA" or S="BBB":
  print("No")
else:
  print("Yes")
Problem p03011 (python)

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

Buggy submission (verdict: Runtime Error):
L = set([int(x) for x in stdin.readline().rstrip().split()])
print(sum(L)-max(L))
Problem p02879 (python)

Fixed submission:
A,B = map(int,input().split())
if(A >= 10 or B >= 10):
    print(-1)
else:
    print(A * B)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = input().split()
F = input().split()
for i in range(0,N):
    A[i] = int(A[i])
    F[i] = int(F[i])
A.sort()
F.sort(reverse=True)

B = [A[i] *F[i] for i in range(0,N)]
d = max(B)

def nex(x):
    count = 0
    for i in range(0,N):
        if x < B[i]:
            count += A[i] - int(x/F[i])
    return count

def target(l,r):
    if r - l == 1:
        if nex(l) <= K:
            return l
        else:
            return r
    elif nex(int((l+r)/2)) <= K:
         return target(l,int((l+r)/2))
    else:
        return target(int((l+r)/2),r)
    
ans = target(0,d)
print(ans)
Problem p03326 (python)

Fixed submission:
n, m = map(int, input().split())
data = [[int(x) for x in input().split()] for _ in range(n)]

pats = [(x,y,z) for x in [-1,1] for y in [-1,1] for z in [-1,1]] # +++,++-,...,---
score = lambda sgns, vals: sum([s * x for(s, x) in zip(sgns, vals)])  # i.e.x+y-z
result = max(sum(sorted((score(pat, row) for row in data), reverse=True )[:m]) for pat in pats)
print(result)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

def score (cids):
    x = abs(sum(data[cid][0] for cid in cids))
    y = abs(sum(data[cid][1] for cid in cids))
    z = abs(sum(data[cid][2] for cid in cids))
    return x + y + z

n, m = map(int, input().split())
data = list([int(x) for x in input().split()] for _ in range(n))
print(max(score(x) for x in combinations(range(n), m)))
~