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

Fixed submission:
L=int(input())
a=L/3
b=a**3
print("{:.12f}".format(b))

Buggy submission (verdict: Runtime Error):
L=int(input())
a=L/3
b=a**3
print("{;.12f}".format(b))

Buggy submission (verdict: Runtime Error):
L=int(input())
a=L/3
b=a**3
print(b[:.13f])
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
L=list(list(map(input().split())) for j in range(M))
win=0
penalty=0
if M==0:
  print(0,0)
else:
  for i in range(M):
    m=int(L[i][0])
    eff=str(L[i][1])
    if eff=="WA":
      if N[m][0]!=1:
        N[m][1]+=1
      else:
        continue
    else:
      if N[m][0]!=1:
        N[m][0]=1
        win+=1
        penalty+=N[m][1]
      else:
        continue
  print(win,penalty)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
L=list(list(map(str,input().split())) for j in range(M))
win=0
peanalty=0
if M==0:
  print(0,0)
else:
  for i in range(M):
    m=int(L[i][0])
    eff=L[i][1]
    if eff=="WA":
      if N[m][0]!=1:
        N[m][1]+=1
      else:
        continue
    else:
      if N[m][0]!=1:
        N[m][0]=1
        win+=1
        penalty+=N[m][1]
      else:
        continue
  print(win,penalty)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
if M==0:
  print(0,0)
else:
  penalty=0
  win=0
  for j in range(M):
    L=list(map(str,input().split()))
    m=int(L[0])
    if L[1]=="WA":
      if N[m][1]!=1:
        penalty+=1
      else:
        continue
    else:
      if N[m][1]!=1:
        N[m][1]=1
        win+=1
      else:
        continue
print(win,penalty)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
if M==0:
  print(0,0)
else:
  penalty=0
  win=0
  for j in range(M):
    L=list(map(str,input().split()))
    m=int(L[0])
    if L[1]=="WA":
      if N[m]!=1:
        penalty+=1
      else:
        continue
    else:
      if N[m]!=1:
        N[m]=1
        win+=1
      else:
        continue
print(win,penalty)
Problem p02817 (python)

Fixed submission:
S,T=map(str,input().split())
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T=map(str(input().split()))
M=str(T)+str(S)
print(M)

Buggy submission (verdict: Runtime Error):
S,T=map(str(input().split()))
print(str(T)+str(S))
Problem p02842 (python)

Fixed submission:
N=int(input())
for i in range(1,N+1):
  if int(i*1.08)==N:
    print(i)
    exit()
print(":(")

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(1,N//(1.08)+3): #X
  if int(i*1.08)==N:
    print(i)
    exit()
print(":(")
Problem p02885 (python)

Fixed submission:
A,B=map(int,input().split())
m=A-2*B
if m<0:
  print(0)
else:
  print(m)

Buggy submission (verdict: Runtime Error):
A,B=int(int,input().split())
m=A-2*B
if m<0:
  print(0)
else:
  print(m)
Problem p02886 (python)

Fixed submission:
N=int(input())
d=list(map(int,input().split()))
s=0
for j in range(N-1):
  for i in range(j+1,N):
    s+=d[j]*d[i]
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
d+=list(map(int,input().split()))
s=0
for j in range(N-1):
  for i in range(j+1,N):
    s+=d[j]*d[i]
print(s)
Problem p02898 (python)

Fixed submission:
N,K=map(int,input().split())
h=list(map(int,input().split()))
s=0
for i in range(N):
    if h[i]>=K:
        s+=1
print(s)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h=list(input())
s=0
for i in range(N):
  if h[i]>=K:
    s+=1
print(s)
Problem p02909 (python)

Fixed submission:
S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S=="Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
S=str(input())
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S="Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
S=input()
if S=="Sunny":
  print("Cloudy")
elif S=="Cloudy":
  print("Rainy")
elif S="Rainy":
  print("Sunny")
Problem p02910 (python)

Fixed submission:
S=input()
i=0
while i<len(S):
  if i%2==0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
      exit()
    else:
      i+=1
print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
i=0
while i<len(S):
  if i%2=0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
    else:
      i+=1
print("Yes")

Buggy submission (verdict: Runtime Error):
S=str(input())
for i in range(len(S)):
  if i%2==0:
    S.replace("R","Q")
  else:
    S.replace("L","Q")
S.replace("U","")
S.replace("D","")
S.replace("Q","")
if S="":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
s=0
for i in range(len(S)):
  if i%2==0:
    if S[i]=="R" or "U" or "D":
      s+=1
  else:
    if S[i]="L" or "U" or "D":
      s+=1
if s==len(S):
  print("Yes")
else:
  print("No")
Problem p02911 (python)

Fixed submission:
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q=map(int,input().split())
L=[K-Q]*N
for j in range(Q):
  A=int(input())
  L[A]+=1
for i in L:
  if i>0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q=map(int,input().split())
L=[K-Q]*N
for j in range(N):
  A=int(input())
  L[A]+=1
for i in L:
  if i>0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K]*N
for i in range(Q):
  m=int(input())-1
  for j in range(N):
    if j!=m:
      L[i]-=1
for k in range(N):
  if L[k]>0:
    print("Yes")
  else:
    print("No")
Problem p02923 (python)

Fixed submission:
N=int(input())
S=list(map(int,input().split()))
a=[]
i=0 #リスト
m=0
while i<N-1:
    if S[i]>=S[i+1]:
        m+=1
        if i<N-3:
            if S[i+1]<S[i+2]:
                a.append(m)
                m=0
    i+=1
a.append(m)
print(max(a))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(map(int,input().split()))
a=[]
for i in range(N-1):
    j=i
    m=0
    while j<N-1 and S[j]>=S[j+1]:
        m+=1
        j+=1
    a.append(m)
print(max(a))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=list(map(int,input().split()))
a=[]
for i in range(N-1):
    j=i
    m=0
    while S[j]>=S[j+1] and j<N-1:
        m+=1
        j+=1
    a.append(m)
print(max(a))
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
  print(0)
else:
  start=L%2019
  end=R%2019
  if start>=end or R-L>=2018: #中に2019の倍数が含まれるとき
    print(0)
  else:
    m=(L*(L+1))%2019
    for i in range(L,R):
      for j in range(i+1,R+1):
        s=(i*j)%2019
        m=min(m,s)
    print(m)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
m=(L*(L+1))%2019
for i in range(L,R):
  for j in rang(i+1,R+1):
    s=(i*j)%2019
    m=min(m,s)
print(m)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
m=(L*(L+1))%2019
for i in range(L,R):
  for j in rang(L+1,R+1):
    s=(i*j)%2019
    m=min(m,s)
print(m)
Problem p03001 (python)

Fixed submission:
W,H,x,y=map(int,input().split())
if x==W/2 and y==H/2:
  print(float(W*H/2),1)
else:
  print(float(W*H/2),0)

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split())
if x==W/2 and y==H/2:
  print(float(W*H/2),1)
elif x==W/2 and (not y==H/2):
  print(float(W*H/2),0)
elif (not x==W/2) and y==H/2:
  print(float(W*H/2),0)
else:
  if H/W==y/x or W/H==-(y/x):
    print(float(W*H/2),0)
  else:
    print(float(W*H/2),0)

Buggy submission (verdict: Runtime Error):
W,H,x,y=map(int,input().split())
if x==W/2 and y==H/2:
  print(float(W*H/2),1)
elif x==W/2 and (not y==H/2):
  print(float(W*H/2),0)
elif (not x==W/2) and y==H/2:
  print(float(W*H/2),0)
else:
  if H/W==y/x or W/H==-(y/x):
    print(float(W*H/2),0)
  else:
    print(float(W*H/2),0)
Problem p03043 (python)

Fixed submission:
N,K=map(int,input().split())
i=0
q=0 #確率
for j in range(1,N+1):
  while j*(2**i)<K:
    i+=1
  q+=(1/N)*((1/2)**i)
  i=0
print(q)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
import math
s=N
q=0 #qは０点になる場合の数
if N>=K:
  for i in range(K):
    if (K//i)%2!=0:
      q+=int(math.log(K//i,2))+1
    else:
      q+=int(math.log(K//i,2))
else:
  for i in range(N+1):
    if (K//i)%2!=0:
      q+=int(math.log(K//i,2))+1
    else:
      q+=int(math.log(K//i,2))
print(s/(s+q))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
import math
s=0
if N-K>=0:
  N-=(N-K+1)
for j in range(1,N+1):
  if (K/j)%2==0:
    s+=math.log2(K//j)
  else:
    s+=int(math.log2(K/j))+1
print(float(N/(s+N)))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
import math
s=0
for j in range(1,N+1):
  if (K/j)%2==0:
    s+=math.log2(K//j)
  else:
    s+=int(math.log2(K/j))+1
print(float(N/(s+N)))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
import math
s=0
for j in range(1,N+1):
  if (K/j)%2==0:
    s+=log2(K//j)
  else:
    s+=int(log2(K/j))+1
print(float(N/(s+N)))
Problem p03049 (python)

Fixed submission:
N=int(input())
s=''
point=0
q1,q2,q3=0,0,0 #q1はBA q2はBの最初のみ q3はAの末尾のみ
for j in range(N):
    n=str(input())
    point+=n.count("AB")
    if n[0]=="B" and n[len(n)-1]=="A":
      q1+=1  
    elif n[0]=="B":
      q2+=1
    elif n[len(n)-1]=="A":
      q3+=1
    else:
      pass
if q1>=1:
  if q2==0 and q3==0:
    print(q1-1+point)
  elif q2==0 or q3==0:
    print(q1-1+1+point)
  else:
    print(q1-1+point+2+min(q2-1,q3-1))
else:
  print(min(q2,q3)+point)

Buggy submission (verdict: Runtime Error):
N=int(input())
s=''
point=0
q1,q2,q3=0,0,0 #q1はBA q2はBの最初のみ q3はAの末尾のみ
for j in range(N):
    n=str(input())
    point+=n.count("AB")
    if n[0]=="B" and n[len(n)-1]=="A":
      q1+=1  
    elif n[0]=="B":
      q2+=1
    elif n[len(n)-1]=="A":
      q3+=1
    else:
      pass
if q1>=1:
  if q2==0 and q3==0:
    print(q1-1+point)
  elif q2==0 or q3==0
    print(q1-1+1+point)
  else:
    print(q1-1+point+2+min(q2-1,q3-1))
else:
  print(min(q2,q3)+point)

Buggy submission (verdict: Runtime Error):
N=int(input())
s=''
point=0
q1,q2,q3=0,0,0 #q1はBA q2はAの末尾のみ q3はBの最初のみ
for j in range(N):
    n=str(input())
    point+=n.count("AB")
    if n[0]=="B" and n[len(n)-1]=="A":
      q1+=1  
    elif n[0]=="B":
      q2+=1
    elif n[len(n)-1]=="A":
      q3+=1
    else:
      pass
A-=1
B-=1
print(q1-1+2+min(q3,q2)+point)
Problem p03378 (python)

Fixed submission:
N,M,X=map(int,input().split())
A=[]
A+=list(map(int,input().split()))
s=0
z=0
for j in range(M):
    if A[j]>X:
        s+=1
    elif A[j]<X:
        z+=1
print(min(s,z))

Buggy submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
A+=list(input())
s=0
z=0
for j in range(M):
  if A[j]>X:
    s+=1
  elif A[j]<X:
    z+=1
print(min(s,z))

Buggy submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
A+=list(input())
s=0
z=0
for j in range(M):
  if A[j]>X:
    s+=1
  elif A[j]<X:
    z+=1
print(min(s,z))
Problem p03456 (python)

Fixed submission:
import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%(math.sqrt(s))==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%(int(math.sqrt(s)))==0
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%int(math.sqrt(s))==0
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%(math.sqrt(s))==0
  print("Yes")
else:
  print("No")
Problem p03545 (python)

Fixed submission:
N=str(input())
a=int(N[0])
b=int(N[1])
c=int(N[2])
d=int(N[3])
for i in range(2):
  for j in range(2):
    for k in range(2):
      t=a
      if i==0:
        t+=b
      else:
        t-=b
        
      if j==0:
        t+=c
      else:
        t-=c
        
      if k==0:
        t+=d
      else:
        t-=d
        
      if t==7:
        print("{}{}{}{}{}{}{}=7".format(a,"+-"[i],b,"+-"[j],c,"+-"[k],d))
        exit()

Buggy submission (verdict: Runtime Error):
N=str(input())
a=int(N[0])
b=int(N[1])
c=int(N[2])
d=int(N[3])
for i in range(2):
  for j in range(2):
    for k in range(2):
      t=a
      if i==0:
        t+=b
      else:
        t-=b
        
      if j==0:
        t+=c
      else:
        t-=c
        
      if k==0:
        t+=d
      else:
        t-=d
        
      if t==7:
        print(f"{a}{"+-"[i]}{b}{"+-"[j]}{c}{"+-"[k]}{d}=7")
Problem p03557 (python)

Fixed submission:
import bisect
point=0
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
for i in range(N):
  m=bisect.bisect_left(A,B[i])
  n=bisect.bisect_right(C,B[i])
  point+=m*(N-n)
print(point)

Buggy submission (verdict: Runtime Error):
import bisect
point=0
N=int(input())
A=list(map(int,input().split())).sort()
B=list(map(int,input().split())).sort()
C=list(map(int,input().split())).sort()
for i in range(N):
  m=bisect.bisect_left(A,B[i])
  n=bisect.bisect_left(C,B[i])
  point+=m*n
print(point)

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()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j1]<A[0]:
  j1+=1
k1=0
while C[k1]<B[j1]:
  k1+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      while k1<N and B[j]>C[k1]:
        k1+=1
      kinds+=(N-k1)
      k1=k1-1
print(kinds)

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()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j1]<A[0]:
  j1+=1
k1=0
while C[k1]<B[j1]:
  k1+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      while k1<N and B[j]>C[k1]:
        k1+=1
      kinds+=(N-k1)
      k1=k1-1

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()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j1]<A[0]:
  j1+=1
k1=0
while C[k1]<B[j1]:
  k1+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      for k in range(k1,N):
        if B[j]<C[k]:
          kinds+=1
print(kinds)

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()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j]<A[0]:
  j1+=1
k1=0
while C[k]<B[j]:
  k1+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      for k in range(k1,N):
        if B[j]<C[k]:
          kinds+=1
print(kinds)

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()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j]<A[0]:
  j+=1
k1=0
while C[k]<B[j]:
  k+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      for k in range(k1,N):
        if B[j]<C[k]:
          kinds+=1
print(kinds)
Problem p03781 (python)

Fixed submission:
X=int(input())
i=1
sum1=1
while sum1<X:
  i+=1
  sum1=sum1+i
print(i)

Buggy submission (verdict: Runtime Error):
X=int(input())
i=1
sum1=1
while sum<X:
  i+=1
  sum1=sum1+i
print(i)

Buggy submission (verdict: Runtime Error):
X=int(input())
import numpy as np
dp=np.array([0]*X)
i=0
while X not in dp:
  i+=1
  dp+=np(dp+np.array(X*[i]))
print(i)
Problem p03816 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
m=len(set(A))
if m%2==0:
  print(m-1)
else:
  print(m)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
m=set(A)
if m%2==0:
  print(m-1)
else:
  print(m)
Problem p04047 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
L.sort()
s=0
for i in range(N):
  s+=L[2*i]
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split()))
L.sort()
s=0
for i in range(N):
  s+=min(L[2i],L[2i+1])
print(s)
Problem p02727 (python)

Fixed submission:
X, Y, A, B, C = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p.sort()
q.sort()
r.sort()
red_remain = X
green_remain = Y
ans = 0
flag = False
for i in range(X+Y):
    if flag:
        flag = False
        continue
    if red_remain == 0 or len(p) == 0:
        if green_remain == 0 or len(q) == 0:
            ans += r.pop(-1)
        elif len(r) == 0:
            ans += q.pop(-1)
            green_remain -= 1
        elif q[-1] < r[-1]:
            ans += r.pop(-1)
        else:
            ans += q.pop(-1)
            green_remain -= 1
    elif green_remain == 0 or len(q) == 0:
        if len(r) == 0:
            ans += p.pop(-1)
            red_remain -= 1
        elif p[-1] < r[-1]:
            ans += r.pop(-1)
        else:
            ans += p.pop(-1)
            red_remain -= 1
    elif len(r) == 0:
        if p[-1] == q[-1]:
            if i == X+Y-1:
                ans += p[-1]
            else:
                flag = True
                ans += p.pop(-1) + q.pop(-1)
                red_remain -= 1
                green_remain -= 1
        elif p[-1] < q[-1]:
            ans += q.pop(-1)
            green_remain -= 1
        else:
            ans += p.pop((-1))
            red_remain -= 1
    else:
        if p[-1] < r[-1] and q[-1] < r[-1]:
            ans += r.pop(-1)
        elif p[-1] == q[-1]:
            if i == X+Y-1:
                ans += p[-1]
            else:
                flag = True
                ans += p.pop(-1) + q.pop(-1)
                red_remain -= 1
                green_remain -= 1
        elif p[-1] < q[-1]:
            ans += q.pop(-1)
            green_remain -= 1
        else:
            ans += p.pop((-1))
            red_remain -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]
r = [int(i) for i in input().split()]
p.sort()
q.sort()
r.sort()
red_remain = X
green_remain = Y
ans = 0
flag = False
for i in range(X+Y):
    if flag:
        flag = False
        continue
    if red_remain == 0 or len(p) == 0:
        if green_remain == 0 or len(q) == 0:
            ans += r.pop(-1)
        elif q[-1] < r[-1]:
            ans += r.pop(-1)
        else:
            ans += q.pop(-1)
            green_remain -= 1
    elif green_remain == 0 or len(q) == 0:
        if p[-1] < r[-1]:
            ans += r.pop(-1)
        else:
            ans += p.pop(-1)
            red_remain -= 1
    else:
        if p[-1] < r[-1] and q[-1] < r[-1]:
            ans += r.pop(-1)
        elif p[-1] == q[-1]:
            if i == X+Y-1:
                ans += p[-1]
            else:
                flag = True
                ans += p.pop(-1) + q.pop(-1)
                red_remain -= 1
                green_remain -= 1
        elif p[-1] < q[-1]:
            ans += q.pop(-1)
            green_remain -= 1
        else:
            ans += p.pop((-1))
            red_remain -= 1
print(ans)
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')
K,X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')
Problem p02900 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
gcd = fractions.gcd(A, B)
ans = 1
sqrt = gcd ** 0.5
for i in range(2, int(sqrt) + 2):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
if sqrt < gcd:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
A, B = map(int, input().split())
gcd = fractions.gcd(A, B)
ans = 1
sqrt = math.sqrt(gcd)
for i in range(2, int(sqrt) + 2):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
if sqrt < gcd:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
gcd = math.gcd(A, B)
ans = 1
sqrt = math.sqrt(gcd)
for i in range(2, int(sqrt) + 2):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
if sqrt < gcd:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
gcd = math.gcd(A, B)
ans = 1
for i in range(2, min(gcd, 1000000)):
    if gcd % i == 0:
        ans += 1
        while True:
            gcd //= i
            if gcd % i != 0:
                break
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions

A,B,C,D = map(int,input().split())

gcd = fractions.gcd(C,D)
lcm = int(C*D/gcd)

ans_A = int((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm)
ans_B = int(B - B//C - B//D + B//lcm)
print(ans_B - ans_A)

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())

gcd = math.gcd(C,D)
lcm = int(C*D/gcd)

ans_A = int((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm)
ans_B = int(B - B//C - B//D + B//lcm)
print(ans_B - ans_A)

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())

gcd = math.gcd(C,D)
lcm = int(C*D/gcd)

comp = int(((lcm//C) + (lcm//D) - 1) * ((B-A+1)//lcm))

for i in range((B-A+1)%lcm):
    if (A+i)%C == 0 or (A+i)%D == 0:
        comp += 1

print(B-A+1-comp)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

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

B = [0] * (N - 1)
C = [0] * (N - 1)

for n in range(N - 1):
    if n == 0:
        B[0] = A[0]
        C[N - 2] = A[N - 1]
    else:
        B[n] = gcd(B[n - 1], A[n])
        C[N - n - 2] = gcd(A[N - n - 1], C[N - n - 1])

ans = 0
for n in range(N):
    if n == 0:
        ans = C[0]
    elif n == N - 1:
        ans = max(ans, B[N - 2])
    else:
        ans = max(ans, gcd(B[n - 1], C[n]))
print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

B = [0] * (N - 1)
C = [0] * (N - 1)

for n in range(N - 1):
    if n == 0:
        B[0] = A[0]
        C[N - 2] = A[N - 1]
    else:
        B[n] = math.gcd(B[n - 1], A[n])
        C[N - n - 2] = math.gcd(A[N - n - 1], C[N - n - 1])

ans = 0
for n in range(N):
    if n == 0:
        ans = C[0]
    elif n == N - 1:
        ans = max(ans, B[N - 2])
    else:
        ans = max(ans, math.gcd(B[n - 1], C[n]))
print(ans)
Problem p03292 (python)

Fixed submission:
A=[int(i) for i in input().split()]
A.sort()
print(A[2]-A[0])

Buggy submission (verdict: Runtime Error):
A=[int(i) for i input().split()]
A.sort()
print(A[2]-A[0])

Buggy submission (verdict: Runtime Error):
A=[int(i) for i ininput().split()]
A.sort()
print(A[2]-A[0])