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

Fixed submission:
n,m=map(int,input().split())
l={int(input()) for i in range(m)}
dp=[0 for i in range(n+1)]
dp[0]=1
for i in range(1,1+n):
    if i not in l:dp[i]+=dp[i-1]+dp[i-2];dp[i]%=10**9+7
print(dp[n])

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l={int(input()) for _ in range(ana)}
@lru_cache(maxsize=100000000000000)
def f(x):
  global l
  if x in l:return 0
  elif x==1:return 1
  elif x==2:return f(1)+1
  else:return (f(x-1)+f(x-2))%(10**9+7)

print(f(dan))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l={int(input()) for _ in range(ana)}
@lru_cache(maxsize=10000000)
def f(x):
  global l
  if x in l:return 0
  elif x==1:return 1
  elif x==2:return f(1)+1
  else:return (f(x-1)+f(x-2))%(10**9+7)

print(f(dan))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l=[int(input()) for _ in range(ana)]
@lru_cache(maxsize=None)
def f(x,*li):
  if x in li:return 0
  elif x==1:return 1
  elif x==2 :return f(1,*li)+1 if 1 not in li else 1 if 2 not in li else 0
  else:return (f(x-1,*li)+f(x-2,*li))%(10**9+7)

print(f(dan,*l))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l=[int(input()) for _ in range(ana)]
@lru_cache(maxsize=float('inf'))
def f(x,*li):
  if x in li:return 0
  elif x==1:return 1
  elif x==2:return f(1,*li)+1
  else:return (f(x-1,*li)+f(x-2,*li))%(10**9+7)

print(f(dan,*l))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l=[int(input()) for _ in range(ana)]
@lru_cache(maxsize=10000000)
def f(x,*li):
  if x in li:return 0
  elif x==1:return 1
  elif x==2:return f(1,*li)+1
  else:return (f(x-1,*li)+f(x-2,*li))%(10**9+7)

print(f(dan,*l))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l=[int(input()) for _ in range(ana)]
@lru_cache(maxsize=10000000)
def f(x,*li):
  if x in li:return 0
  elif x==1:return 1
  elif x==2:return f(1,li)+1
  else:return (f(x-1,li)+f(x-2,li))%(10**9+7)

print(f(dan,*l))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
dan,ana=map(int,input().split())
l=[int(input()) for _ in range(ana)]
@lru_cache(maxsize=10000000)
def f(x,li):
  if x in li:return 0
  elif x==1:return 1
  elif x==2:return f(1,li)+1
  else:return (f(x-1,li)+f(x-2,li))%(10**9+7)

print(f(dan,l))
Problem p03072 (python)

Fixed submission:
p,a=1,0
n=input()
for i in list(map(int,input().split())):
  if p<=i:a+=1
  p=max(i,p)
print(a)

Buggy submission (verdict: Runtime Error):
p,a=1,0
n=input()
for i in list(map(int,input().split())):
  if p<=i:ans+=1
  p=i
print(a)

Buggy submission (verdict: Runtime Error):
p,a=1,0
n=input()
for i in list(map(int,input().split())):
  if p<=i:ans+=1
  p=i
print(ans)
Problem p03073 (python)

Fixed submission:
n=input()
s=""
a=""
sd,ad=0,0
for i in range(len(n)):
  if i%2:
    s+="1"
    a+="0"
  else:
    s+="0"
    a+="1"
for i in range(len(n)):
  if n[i]!=a[i]:ad+=1
  if n[i]!=s[i]:sd+=1
print(min(ad,sd))

Buggy submission (verdict: Runtime Error):
n=input()
s,a="",""
sd,ad=0,0
for i in range(len(n)):
  if i%2:
    s+="1"
    a+="0"
  else:
    s+="0"
    a+="1"
for i in range(n):
  if n[i]!=a[i]:ad+=1
  if n[i]!=s[i]:sd+=1
print(min(ad,sd))
Problem p03075 (python)

Fixed submission:
l=[int(input()) for i in range(5)]
a,c=min(l),max(l)
k=int(input())
print("Yay!") if (a-c)**2<=k**2 else print(":(")

Buggy submission (verdict: Runtime Error):
l=[int(input()) for i in range(5)]
a,c=min(l),max(l)
k=int(input())
print("Yay!") if (a-b)**2<=k**2 else print(":(")
Problem p03104 (python)

Fixed submission:
a,b=map(int,input().split())
c,d=0,0
if a!=0:
  a-=1
  m=(-(-a//2))%2
  c=m if a%2 else m^a
m=m=(-(-b//2))%2
d=m if b%2 else m^b
print(c^d)

Buggy submission (verdict: Runtime Error):
from math import log2 as log
a,b=map(int,input().split())
r,l=int(log(a))+1,int(log(b))
if a==b:print(a);exit()
ans=pow(2,l)+int(r==1)
for i in range(a,pow(2,r)):
  ans^=i
for i in range(pow(2,l)+1,b+1):
  ans^=i
print(ans)
Problem p03135 (python)

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

Buggy submission (verdict: Runtime Error):
a,s=map(int,input().split())
print(a/b)

Buggy submission (verdict: Runtime Error):
a,s=input().split()
print(a/s)
Problem p03137 (python)

Fixed submission:
koma,spot=map(int,input().split())
if koma>=spot:print(0);exit()
l=list(map(int,input().split()))
l.sort()
k=[l[i+1]-l[i]for i in range(spot-1)]
k.sort()
print(sum(k[:spot-koma]))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=sorted(list(map(int,input().split())))
s=[]
for i ,x in zip(l,l[1::]):
    s.append(x-i)
ans=l[-1]-l[0]
s.sort()
for i in range(n-1):
    ans-=s[-i-1]
print(ans)
Problem p03207 (python)

Fixed submission:
l=int(input())
b=[int(input()) for i in range(l)]
print(sum(b)-max(b)//2)

Buggy submission (verdict: Runtime Error):
l=input()
b=list()
for i in range(l)
    a=int(input())
    b.append(a)
print(sum(b)-max(b)/2)

Buggy submission (verdict: Runtime Error):
l=input()
b=[]
for i in range(l)
    a=int(input())
    b.append(a)
print(sum(b)-max(b)/2)

Buggy submission (verdict: Runtime Error):
N=input()
b={}
for i in range(N)
    a=int(input())
    b.append(a)
print(sum(b)-max(b)/2)
Problem p03208 (python)

Fixed submission:
n,k=map(int,input().split())
l=sorted([int(input()) for i in range(n)])
print(min([abs(l[i]-l[i+k-1]) for i in range(n-k+1)]))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=sorted(list(map(int,input().split())))
ret=float("inf")
print(min([abs(l[i]-l[i+k]) for i in range(n-k)]))
Problem p03221 (python)

Fixed submission:
#C-ID
n,m=map(int,input().split())
L={}
lp=[list() for _ in range(n)]#preごとのまとめの準備
for cn in range(m):
  p,y=map(int,input().split())
  lp[p-1].append([y,cn])
for pre in range(n):
  k=len(lp[pre])
  if k>0:
    sd=lp[pre]
    asd=sorted(sd)
    for d in range(k):
      cn=asd[d][1]
      ans="0"*(6-len(str(pre+1)))+str(pre+1)+"0"*(6-len(str(d+1)))+str(d+1)
      L[cn]=ans
for h in range(m):
  print(L[h])

Buggy submission (verdict: Runtime Error):
#C-ID
n,m=map(int,input().split())
L={}
lp=[[] for _ in range(n)]#preごとのまとめの準備
for cn in range(m):
  p,y=map(int,input().split())
  lp[p-1].append([y,cn])
  lp[p-1]=sorted(lp[p-1])
for pre in range(n):
  k=len(lp[pre])
  if k>0:
    for d in range(k):
      cn=lp[pre][k][1]
      ans="0"*(6-len(str(pre)))+str(pre)+"0"*(6-len(str(d+1)))+str(d+1)
      L[cn]=ans
for h in range(m):
  print(L[h])
Problem p03252 (python)

Fixed submission:
s=input();d=input();n=len(s)
di={"abcdefghijklmnopqrstuvwxyz"[i]:i for i in range(26)}
sl,dl=[set() for _ in range(26)],[set() for _ in range(26)]
for i,(x,y) in enumerate(zip(s,d)):
  sl[di[x]].add(i);dl[di[y]].add(i)
for i in dl:
  if i and i not in sl :print("No");exit() 
print("Yes")

Buggy submission (verdict: Runtime Error):
s,t=input(),input()
ss,ts=[set()for i in range(26)],[set()for i in range(26)]
sc={}
tc={}
for i in range(len(s)):
    if s[i]not in sc:
        if t[i] in tc:print("No");exit()
        else:
            d=len(sc)
            ss[d].add(i)
            ts[d].add(i)
            tc[t[i]]=d
            sc[s[i]]=d
    else:
        if sc[s[i]]!=tc[t[i]]:print("No");exit()
        else:
            ss[sc[s[i]]].add(i)
            ts[sc[s[i]]].add(i)
for i in range(26):
    if ss[i]!=ts[i]:print("No");break
else:print("Yes")
Problem p03327 (python)

Fixed submission:
print("ABD" if int(input())>999 else "ABC")

Buggy submission (verdict: Runtime Error):
print("ABD" if int(input())>999 else "ABC)
Problem p03426 (python)

Fixed submission:
h,w,d=map(int,input().split())
ind={}
for i in range(h):
    l=list(map(int,input().split()))

    for j in range(w):
        ind[l[j]]=(i,j)
table=[0]*((((h*w)//d).bit_length())*h*w)
now=1
for i in range(1,h*w-d+1):
    a,s=ind[i]
    de,f=ind[i+d]
    table[i-1+d]=abs(a-de)+abs(s-f)
step=2
for i in range(1,((h*w)//d).bit_length()):
    for j in range(1,h*w-step*d+1):
        table[j-1+step*d+i*h*w]=table[j-1+d*step//2+(i-1)*h*w]+table[j-1+d*step+(i-1)*h*w]
    step*=2
#print(*[table[k*h*w:k*w*h+h*w]for k in range(((h*w)//d).bit_length())],sep="\n")
q=int(input())
for i in range(q):
    l,r=map(int,input().split())
    times=(r-l)//d
    cost=0
    now=1
    kata=0
    while times:
        if times%2:
            l+=d*now
            cost+=table[l-1+kata*h*w]

        times//=2
        now*=2
        kata+=1
    print(cost)

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.buffer.readline
inputs=sys.stdin.buffer.readlines
sys.setrecursionlimit(10**9)
h,w,d=map(int,input().split())
inds={}
for i in range(h):
    for d,j in enumerate(input().split()):
        inds[int(j)-1]=(i,d)
nows=[[0]for c in range(d)]
for k in range(d,h*w):
    a,b=inds[k]
    x,y=inds[k-d]
    k%=d
    nows[k].append(nows[k][-1]+abs(a-x)+abs(b-y))
q=input()
for i in inputs():
    l,r=map(int,i.split())
    l-=1;r-=1
    l,b=divmod(l,d)
    r,b=divmod(r,d)
    print(nows[b][r]-nows[b][l])
Problem p03724 (python)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
for i in range(m):
    a,s=map(int,input().split())
    l[a]+=1
    l[s]+=1
for i in l:
    if i%2:print("NO");exit()
print("YES")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
c=sum([list(map(int,input().split())) for i in range(m)],[])
from collections import Counter as co
for i in co(c).values():
    if i%2:print("NO");exit()
  print("YES")
Problem p03775 (python)

Fixed submission:
n=int(input())
m=int((n**(1/2))//1+1)
l=[]
for i in list(range(m+1))[:0:-1]:
  if n%i==0:
    l.append(max(len(str(i)),len(str(n//i))))
  if len(l)==3:
    break
print(min(l))

Buggy submission (verdict: Runtime Error):
from math imoprt sqrt
n=int(input())
for i in range(int(sqrt(n)),0,-1):
  if n%i==0:
    print(max(len(str(i)),len(str(n//i))))
    exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
m=n**(1/2)//1+1
l=[]
for i in range(m+1)[:0:-1]:
  if n%i==0:
    l.append(max(len(str(i)),len(str(n//i))))
  if len(l)==3:
    break
print(min(l))
Problem p03785 (python)

Fixed submission:
n,c,k=map(int,input().split())
ans=0
cnt=1
t=sorted([int(input())for s in range(n)])
while t:
    now=t.pop()
    ans+=1
    while t and cnt<c and t[-1]+k>=now:
        cnt+=1
        t.pop()
    cnt=1

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter as co
hit,te,ji=map(int,input().split())
l=list(co(sorted([int(input()) for u in range(hit)])).items())
inc=0
ans=0
ef=len(l)
for ix in range(hit):
  k,v=l[inc]
  ans-=(-v//te)
  nokori=te-v%te if v%te else 0
  inc+=1
  if inc==ef:break
  while nokori:
    if l[inc][0]>k+ji:
      break
    if l[inc][1]<=nokori:
      nokori-=l[inc][1]
      inc+=1
      if inc==ef:break
    else:l[inc][1]-=nokori;break
print(ans+1 if nokori else ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter as co
hit,te,ji=map(int,input().split())
l=list(co(sorted([int(input()) for u in range(hit)])).items())
inc=0
ans=0
ef=len(l)
for ix in range(hit):
  k,v=l[inc]
  ans-=(-v//te)
  nokori=te-v%te if v%te else 0
  inc+=1
  while nokori:
    if l[inc][0]>k+ji:break
    if l[inc][1]<=nokori:
      nokori-=l[inc][1]
      inc+=1
      if inc==ef:break
    else:l[inc][1]-=nokori;break
  if inc==ef:break
print(ans+1 if nokori else ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter as co
hit,te,ji=map(int,input().split())
l=list(co(sorted([int(input()) for u in range(hit)])).items())
inc=0
ans=0
ef=len(l)
if ef==1:print(-(-l[0][1]//te));break
for ix in range(hit):
  k,v=l[0]
  ans-=(-v//te)
  nokori=te-v%te if v%te else 0
  inc+=1
  while nokori:
    if l[inc][0]>k+ji:break
    if l[inc][1]<=nokori:
      nokori-=l[inc][1]
      inc+=1
      if inc==ef:
        break
    else:
      l[inc][1]-=nokori
      break
  if inc==ef:
    break
print(ans+1 if nokori else ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter as co
hit,te,ji=map(int,input().split())
l=list(co(sorted([int(input()) for u in range(hit)])).items())
inc=0
ans=0
ef=len(l)
for ix in range(hit):
  k,v=l[0]
  ans-=(-v//te)
  nokori=te-v%te if v%te else 0
  inc+=1
  while nokori:
    if l[inc][0]>k+ji:break
    if l[inc][1]<=nokori:
      nokori-=l[inc][1]
      inc+=1
      if inc==ef:break
    else:l[inc][1]-=nokori;break
  if inc==ef:break
print(ans+1 if nokori else ans)
Problem p03834 (python)

Fixed submission:
a,s,d=input().split(',')
print(a,s,d)

Buggy submission (verdict: Runtime Error):
a,s,d=input(),split(',')
print(a,s,d)
Problem p03835 (python)

Fixed submission:
k,s=map(int,input().split())
ans=0
for a in range(k+1):
  for b in range(k+1):
    if 0<=(s-a-b)<=k:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
k,s=map(int,input(),split())
ans=0
for a in range(k+1):
  for b in range(k+1):
    if 0<=(s-a-b)<=k:
      ans+=1
print(ans)k,s=map(int,input().split())
ans=0
for a in range(k+1):
  for b in range(k+1):
    if 0<=(s-a-b)<=k:
      ans+=1
print(ans)
Problem p02571 (python)

Fixed submission:
s = input()
t = input()
ans = len(t)
for i in range(len(s) - len(t) + 1):
    ans = min(ans, sum(si != ti for si, ti in zip(s[i:], t)))
print(ans)

Buggy submission (verdict: Runtime Error):
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:],t[:-1]))for i in range(len(s)-len(t))))
Problem p02689 (python)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1] * n
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if h[a] <= h[b]:
        ans[a] = 0
    if h[b] <= h[a]:
        ans[b] = 0
print(sum(ans))

Buggy submission (verdict: Runtime Error):
n,*t=map(int,open(0).read().split())
r=[0]+[1]*n
for a,b in zip(t[n::2],t[n+1::2]):r[a]&=t[a]>t[b];r[b]&=t[b]>t[a]
print(sum(r))
Problem p02659 (python)

Fixed submission:
a,b=map(str,input().split())
b=b.replace('.','')
ans=int(a)*int(b)//100
print(ans)

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

ans=1
for i in a:
  ans=ans*i
  if ans>10**18:
    ans=-1
    break
    
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(input().split())
b.replace('.','')
ans=int(a)*int(b)//100
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
b=int(b*100)
ans=a*b//100
print(ans)
Problem p02711 (python)

Fixed submission:
n=list(input())

if '7' in n:
  print('Yes')
  
else:
  print('No')

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

rn=s.count('R')
gn=s.count('G')
bn=n-rn-gn

ans=0
if n>2:
  
  for x in range(len(s)-2):
    if s[x]=='R':
      rn-=1
      ans+=gn*bn
    elif s[x]=='G':
      gn-=1
      ans+=rn*bn
    else:
      bn-=1
      ans+=gn*rn
    y=(n-1-x)//2
    for i in range(1,y+1):
      if  (not s[x]==s[x+i]) & (not s[x]==s[x+i+i]) & (not s[x+i]==s[x+i+i]):
        ans-=1
        
  print(ans)
    
else:
  print(0)
Problem p02723 (python)

Fixed submission:
s=list(input())

if s[2]==s[3] and s[4]==s[5]:
  print('Yes')
  
else:
  print('No')

Buggy submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(k-max(ans,c))
Problem p02725 (python)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(k-max(ans,c))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(max(ans,c))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n]+a[0]

print(max(ans,c))
Problem p02759 (python)

Fixed submission:
n=int(input())

s=n//2
a=n%2

if a==1:
  print(s+1)
else:
  print(s)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
jouken=[]
for x in range(m):
  jouken.append(list(map(int,input().split())))

for x in range(10**n):
  ans=0
  for y in range(m):
    a=jouken[y][0]-1
    b=jouken[y][1]
    if not x[a]==b:
      ans+=1
  if ans==0:
    print(x)
    break

if ans>1:
  print(-1)
Problem p02792 (python)

Fixed submission:
n=int(input())
a=[[0 for _ in range(9)] for _ in range(9)]

for i in range(1,n+1):
  x=int(str(i)[0])
  y=int(str(i)[-1])
  if x!=0 and y!=0:
    a[x-1][y-1]+=1
  
ans=0
  
for i in range(9):
  for j in range(9):
    if i!=j:
      
      ans+=a[i][j]*a[j][i]
      
    else:
      ans+=(a[i][i]*a[i][i])
      
print(ans)

Buggy submission (verdict: Runtime Error):
[[0 for _ in range(9)] for _ in range(9)]

for i in range(1,n+1):
  x=int(str(i)[0])
  y=int(str(i)[-1])
  if x!=0 and y!=0:
    a[x-1][y-1]+=1
  
ans=0
  
for i in range(9):
  for j in range(9):
    if i!=j:
      
      ans+=a[i][j]*a[j][i]
      
    else:
      ans+=(a[i][i]*a[i][i])
      
print(ans)
Problem p02862 (python)

Fixed submission:
mod = 10**9+7
def comb(n, k):
    c = 1
    for i in range(k):
        c *= n - i
        c %= mod
    d = 1
    for i in range(1, k + 1):
        d *= i
        d %= mod
    return (c * pow(d, mod - 2, mod)) % mod
x,y=map(int,input().split())

ans=0

z=x//2

for q in range(z,x+1):
  w=2*q-x
  if w*2+(q-w)==y:
    t=comb(q,w)
    ans+=t
    
  
  
print(ans)

Buggy submission (verdict: Runtime Error):
od = 10**9+7
def comb(n, k):
    c = 1
    for i in range(k):
        c *= n - i
        c %= mod
    d = 1
    for i in range(1, k + 1):
        d *= i
        d %= mod
    return (c * pow(d, mod - 2, mod)) % mod
x,y=map(int,input().split())

ans=0

z=x//2+1

for q in range(z,x+1):
  w=2*q-x
  if w*2+(q-w)==y:
    t=comb(q,w)
    ans+=t
    
  
  
print(ans)
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print(1/2)
else:
  print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
  print(1/2)
else:
  print((n+1)/2n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(1/2)
else:
  print((n+1)/2n)
Problem p02915 (python)

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

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

RL=0
LR=0

fo=0

if n<3:
  if n==1:
    print(0)
  else:
    print(1)
    
else:
  for i in range(n):
    if s[i]=='R' and i<n-1:
      if s[i+1]=='R':
        fo+=1
    if s[i]=='L' and 0<i:
      if s[i-1]=='L':
        fo+=1
        
    if i<n-1:
      if s[i]=='R' and s[i+1]=='L':
        RL+=1
      elif s[i]=='L' and s[i+1]=='R':
        LR+=1
        
  si=min(k,RL,LR)
  no=k-si
  LR_rest=LR-si
  RL_rest=RL-si
  if no==0:
    ans=fo+si*2
  else:
    ans=fo+si*2
    if s[0]=='L':
      if LR_rest>0:
        ans+=1
        LR_rest-=1
        no-=1
    if no>0:
      if s[-1]=='R':
        if LR_rest>0:
          ans+=1
  print(ans)
Problem p02935 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
c=(b[0]+b[1])/2
for i in range(2,n):
  c=(c+b[i])/2
print(c)

Buggy submission (verdict: Runtime Error):
n=input()
a=list(map(int,input().split()))
b=a.sorted
c=(b[0]+b[1])/2
for i in range(3,n+1):
  c=(c+b[i])/2
print(c)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(range(n))
b=0
for i in range(n):
  if len(str(a[i]))%2==1:
    b+=1
print(b)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=a-b
e=c-d
if >=0:
  print(e)
else:
  print(0)

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

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
if b[(int(n/2)-1)]==b[int((n/2))]:
  print(0)
else:
  c=b[int((n/2)-1)]
  d=b[int((n/2))]
  e=len(list(range(c,d)))
  print(e)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
if b[(n/2)-1]=b[(n/2)+1]:
  print(0)
else:
  c=b[(n/2)-1]
  d=b[(n/2)+1]
  e=count(range(c,d))
  print(e+1)
Problem p03075 (python)

Fixed submission:
s=[int(input()) for _ in range(6)]
print(':(') if s[4]-s[0]>s[5] else print('Yay!')

Buggy submission (verdict: Runtime Error):
s=[int,input() for _ in range(6)]
print(':(') if s[4]-s[0]>s[5] else print('Yay!')
Problem p03127 (python)

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

a=sorted(a)

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
c=make_divisors(a[0])


d=sorted(c)
f=[]
for y in range(len(d)):
  e=d[y]
  ch=0
  for x in range(1,n):
    if not a[x]%e==0:
      continue
    ch+=1
  if ch==n-1:
    f.append(e)
    
print(max(f))

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

a=sorted(a)

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
c=make_divisors(a[0])
d=list(c.keys)

d=d.sorted
f=[]
for y in range(len(d))
  e=d[y]
  ch=0
  for x in range(1,n):
    if not a[x]%e==0:
      continue
    ch+=1
  if ch==n-1:
    f.append(e)
    
print(max(f))
Problem p03208 (python)

Fixed submission:
n,k=map(int,input().split())
a=[]
for x in range(n):
  a.append(int(input()))
ans=1000000009
a=sorted(a)
for y in range(n-k+1):
  ans=min(a[y+k-1]-a[y],ans)
  
print(ans)

Buggy submission (verdict: Runtime Error):
,k=map(int,input().split())
a=[]
for x in range(n):
  a.append(int(input()))
ans=1000000009
a=sorted(a)
for y in range(n-k+1):
  ans=min(a[y+k-1]-a[y],ans)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=[]
for x in range(n):
  a.append(int(input()))
ans=1000000009
sorted(a)
for y in range(n-k):
  ans(a[y+k-1]-a[y],ans)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=[]
for i in range(n):
  a.append(input())
b=sort.a
print(b(n-1)-b(n-k+1))