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

Fixed submission:
nn=[2,5,5,4,5,6,3,7,6]
n,m=map(int,input().split())
a=input().split()
b=[]
for i in range(m):
  a[i]=int(a[i])
  
if 5 in a:
  if 2 in a:
    a.remove(2)
  if 3 in a:
    a.remove(3)
elif 3 in a:
  if 2 in a:
    a.remove(2)
if 9 in a:
  if 6 in a:
    a.remove(6)
    
a.sort(reverse=True)
for i in range(len(a)):
  b.append(nn[a[i]-1])
  
dp=[-10*18 for _ in range(n+1)]
dp[0]=0
for i in range(n):
  for j in range(len(b)):
    if i+b[j]>n:
      continue
    dp[i+b[j]]=max(dp[i+b[j]],dp[i]+1)
    
k=dp[n]
ans=""
for i in range(k):
  for j in range(len(b)):
    if n-b[j]<0:
      continue
    if dp[n-b[j]]==dp[n]-1:
      ans+=str(a[j])
      n-=b[j]
      break
      
print(ans)

Buggy submission (verdict: Runtime Error):
nn=[2,5,5,4,5,6,3,7,6]
n,m=map(int,input().split())
a=input().split()
b=[]
for i in range(m):
  a[i]=int(a[i])
  
if 5 in a:
  if 2 in a:
    a.remove(2)
  if 3 in a:
    a.remove(3)
elif 3 in a:
  if 2 in a:
    a.remove(2)
if 9 in a:
  if 6 in a:
    a.remove(6)
    
a.sort(reverse=True)
for i in range(len(a)):
  b.append(nn[a[i]-1])
  
dp=[-10*18 for _ in range(n+1)]
dp[0]=0
for i in range(n):
  for j in range(len(b)):
    if i+b[j]>n:
      continue
    dp[i+b[j]]=max(dp[i+b[j]],dp[i]+1)
    
k=dp[n]
ans=""
for i in range(k):
  for j in range(len(b)):
    if dp[n-b[j]]==dp[n]-1:
      ans+=str(a[j])
      n-=b[j]
      break
      
print(ans)

Buggy submission (verdict: Runtime Error):
nn=[[1,2],[7,3],[4,4],[5,5],[3,5],[2,5],[9,6],[6,6],[8,7]]
n,m=map(int,input().split())
a=input().split()
for i in range(m):
  a[i]=int(a[i])
b=[]
for i in range(9):
  if nn[i][0] in a:
    b.append(nn[i])
  
c=[b[0]]
del b[0]
for i in range(len(b)):
  t=0
  for j in range(len(c)):
    if b[i][1] == c[j][1]:
      t=1
      break
  if t==1:
    continue
  c.append(b[i])
  
t=n//c[0][1]
n-=c[0][1]*t
a=c[0]
del c[0]
for i in range(len(c)):
  c[i][1]-=a[1]

ans=""
while c[0][1] <= n:
  for i in range(len(c)):
    i=len(c)-1-i
    if c[i][1]<=n:
      ans+=str(c[i][0])
      n-=c[i][1]
      t-=1
      break
      
ans+=str(a[0])*t
print(ans)
Problem p03129 (python)

Fixed submission:
n,k= map(int, input().split())
if n+1>=k*2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
l=int(input())
a=[]
for k in range(l):
    a.append(int(input()))
ans=9999
for i in range(l):
    for j in range(l):
        if i<j:
            for k in range(j-i+1):
                k+=i
                n=0
                m=0
                for t in range(k-i):
                    t+=i
                    if a[t] % 2 == 0:
                        n+=1
                    else:
                        m+=1
                for t in range(j-k+1):
                    t+=k
                    if a[t] % 2 == 0:
                        m+=1
                    else:
                        n+=1
                if ans>m:
                    ans=m
                if ans>n:
                    ans=n
print(ans)

Buggy submission (verdict: Runtime Error):
n,k= map(int, input().split())
if n+1>2*k:
    print(YES)
else:
    print(NO)
Problem p03130 (python)

Fixed submission:
a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
a3,b3=map(int,input().split())
m = [a1,b1,a2,b2,a3,b3]

n={1:0,2:0,3:0,4:0}
for x in m:
    n[x]+=1
    
t=0
for i in range(4):
    i+=1
    if n[i] != 1 and n[i] != 2:
        t=1
        
if t == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a1,b1=map(int,input().split())
a2,b3=map(int,input().split())
a2,b3=map(int,input().split())
m = [a1,b1,a2,b2,a3,b3]

n={1:0,2:0,3:0,4:0}
for x in m:
    n[x]+=1
    
t=0
for i in range(3):
    i+=1
    if n[i] != 1 and n[i] != 2:
        t=1
        
if t == 0:
    print("YES")
else:
    print("NO")
Problem p03136 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
a=sum(l)
ans='Yes'
for i in l:
  if a-i<=i:
    ans='No'
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
a=sun(l)
ans='Yes'
for i in l:
  if a-i<i:
    ans='No'
print(ans)
Problem p03146 (python)

Fixed submission:
s=[int(input())]
i=0
while 1>0:
  if s[i]%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+2)
    break
  i+=1
  s+=[b]

Buggy submission (verdict: Runtime Error):
s=[int(input())]
i=0
while 1>0:
  if i%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+1)
    break
  i+=1
Problem p03150 (python)

Fixed submission:
a="keyence"
s=input()
ans=1
for i in range(len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]==a:
      ans=0
print("YNEOS"[ans::2])

Buggy submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in range(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.rfind(n)
  if m==-1 or n==-1:
    continue
  if n-m>=len(m):
    ans=0
    break
print("YNEOS"[ans::2])

Buggy submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in rangn(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.find(n)
  if m==-1 or n==-1:
    continue
  if n-m>=i:
    ans=0
    break
print("YNEOS"[ans::2])

Buggy submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in rangn(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.find(n)
  if m==-1 or n==-1:
    continue
  if n-m>=i:
    ans=0
    break
print("YNeos"[ans::2])
Problem p03192 (python)

Fixed submission:
print(input().count('2'))

Buggy submission (verdict: Runtime Error):
print(input().conut('2'))
Problem p03211 (python)

Fixed submission:
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(753-int(a[i:i+3]))
  ans=min(ans,b)
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(765-a[i:i+3])
  ans=min(ans,b)
print(ans)
Problem p03238 (python)

Fixed submission:
if int(input())==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
i=int(input);print(i()+i()if 1<i()else'Hello World')

Buggy submission (verdict: Runtime Error):
i=int(input);print(i()+i()if1<i()else'Hello World')

Buggy submission (verdict: Runtime Error):
if input()==1:
  print("Hello World")
else:
  a,b=input(),input();print(a+b)
Problem p03239 (python)

Fixed submission:
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans==100000000:
  print('TLE')
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans=100000000
  print('TLE')
else:
  print(ans)
Problem p03240 (python)

Fixed submission:
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
d=[]
for i in range(n):
  if p[i][2]==0:
    d.append(i)
d.sort(reverse=1)
for i in d:
  del p[i]
if len(p)==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        if h==0:
          continue
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
for i in range(n):
  if p[i][2]==0:
    p.del(i)
if len(p)==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        if h==0:
          continue
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        if h==0:
          continue
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][1])+abs(j-p[0][1])
      for x,y,h in p:
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][1])+abs(j-p[0][1])
      for x,y,h in p:
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[list(map(int,input().split()))]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(1,101):
    for j in range(1,101):
      k=1
      l=p[0][2]+abs(i-p[0][1])+abs(j-p[0][1])
      for x,y,h in p:
        m=abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])
Problem p03244 (python)

Fixed submission:
n=int(input())
s=list(map(int,input().split()))
d1=dict()
d2=dict()
for i in range(0,n,2):
  if s[i] not in d1:
    d1[s[i]]=1
  else:
    d1[s[i]]+=1
for i in range(1,n,2):
  if s[i] not in d2:
    d2[s[i]]=1
  else:
    d2[s[i]]+=1
dmk,dm,dmmk,dmm=[],0,[],0
for i in d1.keys():
  if dm<d1[i]:
    dmm=dm
    dmmk=dmk
    dm=d1[i]
    dmk=[i]
  elif d1==d1[i]:
    dmk+=[i]
  elif dmm<d1[i]:
    dmm=d1[i]
    dmmk=[i]
  elif dmm==d1[i]:
    dmmk+=[i]
d1=[dm,dmk,dmm,dmmk]
dmk,dm,dmmk,dmm=[],0,[],0
for i in d2.keys():
  if dm<d2[i]:
    dmm=dm
    dmmk=dmk
    dm=d2[i]
    dmk=[i]
  elif d2==d2[i]:
    dmk+=[i]
  elif dmm<d2[i]:
    dmm=d2[i]
    dmmk=[i]
  elif dmm==d2[i]:
    dmmk+=[i]
d2=[dm,dmk,dmm,dmmk]
if len(d1[1])>1 or len(d2[1])>1 or d1[1]!=d2[1]:
  print(n-d1[0]-d2[0])
else:
  print(n-max(d1[0]+d2[2],d1[2]+d2[0]))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(int,input().split()))
d1=dict()
d2=dict()
for i in range(0,n,2):
  if i not in d1:
    d1[i]=1
  else:
    d1[i]+=1
for i in range(1,n,2):
  if i not in d2:
    d2[i]=1
  else:
    d2[i]+=1
dmk,dm,dmmk,dmm=[],0,[],0
for i in d1.keys():
  if dm<d1[i]:
    dmm=dm
    dmmk=dmk
    dm=d1[i]
    dmk=[i]
  elif d1==d1[i]:
    dmk+=[i]
  elif dmm<d1[i]:
    dmm=d1[i]
    dmmk=[i]
  elif dmm=d1[i]:
    dmmk+=[i]
d1=[len(dmk),len(dmmk)]
dmk,dm,dmmk,dmm=[],0,[],0
for i in d2.keys():
  if dm<d2[i]:
    dmm=dm
    dmmk=dmk
    dm=d2[i]
    dmk=[i]
  elif d2==d2[i]:
    dmk+=[i]
  elif dmm<d2[i]:
    dmm=d2[i]
    dmmk=[i]
  elif dmm=d2[i]:
    dmmk+=[i]
d2=[len(dmk),len(dmmk)]
if d1[0]>1 or d2[0]>1:
  print(n-d1[0]-d2[0])
else:
  print(n-max(d1[0]+d2[1],d1[1]+d2[0]))
Problem p03262 (python)

Fixed submission:
n,x=map(int,input().split())
m=list(map(lambda y:int(y)-x,input().split()))
if 0 in m:
  m.remove(0)
ans=abs(m[0])
for i in m:
  i=abs(i)
  while 1:
    ans%=i
    ans,i=i,ans
    if i==0:
      break
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=list(map(lambda x:int(x)-x,input().split()))
if 0 in m:
  m.remove(0)
ans=abs(m[0])
for i in m:
  i=abs(i)
  while 1:
    ans%=i
    ans,i=i,ans
    if i==0:
      break
print(ans)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
h1=[0 for i in range(h)]
w1=[0 for i in range(w)]
m=[]
for i in range(h):
  a=input()
  m+=[a]
  if not "#" in a:
    h1[i]=1
    
for i in range(w):
  k=1
  for j in range(len(m)):
    if m[j][i]=="#":
      k=0
      break
  if k==1:
    w1[i]=1
    
for i in range(h):
  if h1[i]==1:
    continue
  ans=""
  for j in range(w):
    if w1[j]==1:
      continue
    ans+=m[i][j]
  print(ans)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
h1=[0 for i in range(h)]
w1=[0 for i in range(w)]
for i in range(h):
  a=input()
  m+=[a]
  if not "#" in a:
    h1[i]=1
    
for i in range(w):
  k=1
  for j in range(len(m)):
    if m[j][i]=="#":
      k=0
      break
  if k==1:
    w1[i]=1
    
for i in range(h):
  if h1[i]==1:
    continue
  ans=""
  for j in range(w):
    if w1[j]==1:
      continue
    ans+=m[i][j]
  print(ans)
Problem p03284 (python)

Fixed submission:
print(1if eval(input().replace(" ","%"))>0else 0)

Buggy submission (verdict: Runtime Error):
print(1if eval("%".join(input()))>0else 0)
Problem p03288 (python)

Fixed submission:
a=int(input())
if a<1200:
  print("ABC")
elif a<2800:
  print("ARC")
else:
  print("AGC")

Buggy submission (verdict: Runtime Error):
a=int(input())
print("ABC")if a<1200
print("ARC")if a<2800
print("AGC")if a>2799

Buggy submission (verdict: Runtime Error):
a=int(input())
print("ABC"if a<1200)
print("ARC"if a<2800)
print("AGC"if a>2799)

Buggy submission (verdict: Runtime Error):
a=int(input());print("ABC"if a<1200"ARC"elif a<2800else"AGC")
Problem p03289 (python)

Fixed submission:
a=input()
ans="AC"
if not a[0]=="A":
  ans="WA"
if not a[2:-1].count("C")==1:
  ans="WA"
a=a.replace("A","",1).replace("C","",1)
if not a.islower():
  ans="WA"
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
ans="AC"
if not a[0]=="A":
  ans="WA"
if not "C" in a[2:-2]:
  ans="WA"
a.remove("A").remove("C")
if not a.islower():
  ans="WA"
print(ans)
Problem p03290 (python)

Fixed submission:
d,g=map(int,input().split())
g//=100
l=[]
ans=1000
for i in range(1,d+1):
  p,c=map(int,input().split())
  c//=100
  l+=[[p,c,i*p,i*p+c]]
for i in range(2**d):
  score=0
  a=0
  b=1
  c=0
  if not i:
    b=d
  while i:
    if i%2>0:
      score+=l[a][3]
      c+=l[a][0]
    else:
      b=a+1
    a+=1
    i//=2
  if score>=g:
    ans=min(ans,c)
  elif score+l[b-1][2]>=g:
    ans=min(ans,c+(g-score)//b+((g-score)%b>0))
print(ans)

Buggy submission (verdict: Runtime Error):
d,g=map(int,input().split())
g//=100
l=[]
ans=1000
for i in range(d):
  p,c=map(int,input().split())
  l+=[[p,c,i*p,i*p+c]]
#dp[c][i]
dp=[0for i in range(2**d-1)]
for i in range(2**d-1):
  a=1
  b,c=i,0
  d=0
  while b:
    if b%2>0:
      dp[i]+=l[c][3]
      d+=l[c][0]
    else:
      a=c+1
    b//=2
    c+=1
  if dp[i]>=g:
    ans=min(ans,d)
  elif dp[i]+l[a][2]>=g:
    ans=min(ans,d+(g-dp[i])//a+((g-dp[i])%a))
print(ans)

Buggy submission (verdict: Runtime Error):
d,g=map(int,input().split())
g//=100
l=[]
ans=1000
for i in range(d):
  p,c=map(int,input().split())
  l+=[[p,c,i*p,i*p+c]]
#dp[c][i]
dp=[[0for i in range(d)]for i in range(2**d-1)]
for i in range(2**d-1):
  a=0
  b,c=i,0
  d=0
  while b:
    if b%2>0:
      dp[i]+=l[c][3]
      d+=l[i][0]
    else:
      a=c
    b//=2
    c+=1
  if dp[i]+l[a][2]>=g:
    ans=min(ans,d+(g-dp[i])//a+((g-dp[i])%a))
print(ans)
Problem p03292 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=int(input())
print(max(a,b,c)-min(a,b,c))

Buggy submission (verdict: Runtime Error):
a=input();print(eval(max(a)+"-"+min(a)))
Problem p03293 (python)

Fixed submission:
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j2=(j+i)%len(a)
    if a[j]!=b[j2]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(n)
    if a[j]!=b[j]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)
Problem p03319 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
m=a.index(1)
ans=m//(k-1)+(n-m-1)//(k-1)
kk=m%(k-1)+(n-m-1)%(k-1)+1
if m!=0 and m!=n-1:
  if kk>1:
    ans+=1+(kk>k)
else:
  ans+=(ans*(k-1)+1<n)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
m=a.find(1)
ans=m//(k-1)+(n-m-1)//(k-1)
kk=m%(k-1)+(n-m-1)%(k-1)+1
ans+=1+(kk>k)
print(ans)
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(max(a+b,a-b,a＊b))
Problem p03355 (python)

Fixed submission:
s=input()
k=int(input())
l=[]
for i in range(len(s)):
  for j in range(i+1,min(len(s),i+k)+1):
    if s[i:j] not in l:
      l.append(s[i:j])
l.sort()
print(l[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
l=[]
for i in range(len(s)-1):
  for j in range(i+1,min(len(s),i+5)):
    if s[i:j] not in l:
      l.append(s[i:j])
l.sort()
print(l[k-1])
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
l=["."*(w+2)]
for i in range(h):
  l+=["."+input()+"."]
l+=["."*(w+2)]
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if l[i][j]==".":
      continue
    if l[i+1][j]=="#" or l[i-1][j]=="#" or l[i][j+1]=="#" or l[i][j-1]=="#":
      continue
    ans=1
print("YNeos"[ans::2])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
l=[["."for i in range(w+2)],[".",input().split(),"."]for i in range(h),["."for i in range(w+2)]]
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if l[i][j]==".":
      continue
    if l[i+1][j]=="#" and l[i-1][j]=="#" and l[i][j+1]=="#" and l[i][j-1]=="#":
      continue
    ans=1
print("YNeos"[ans::2])
Problem p03363 (python)

Fixed submission:
n=int(input())
l=[0]+list(map(int,input().split()))
for i in range(1,n+1):
  l[i]+=l[i-1]
d={}
for i in l:
  if i not in d:
    d[i]=1
  else:
    d[i]+=1
ans=0
for a in d.values():
  ans+=a*(a-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input()))
s=set(l)
ans=0
for i in s:
  a=l.count(i)
  ans+=a*(a-1)//2
print(ans)
Problem p03378 (python)

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

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
l=[0for i in range(n+1)]
for i in map(int,input().split()):
  l[i]=1
for i in range(1,n+1):
  l[i]+=l[i-1]
print(min(l[x],l[n])
Problem p03435 (python)

Fixed submission:
m=[list(map(int,input().split()))for i in range(3)]
ans=0
if m[0][0]-m[1][0]!=m[0][1]-m[1][1]:
  ans=1
if m[0][0]-m[1][0]!=m[0][2]-m[1][2]:
  ans=1
if m[0][0]-m[2][0]!=m[0][1]-m[2][1]:
  ans=1
if m[0][0]-m[2][0]!=m[0][2]-m[2][2]:
  ans=1
if m[0][0]-m[0][1]!=m[1][0]-m[1][1]:
  ans=1
if m[0][0]-m[0][1]!=m[2][0]-m[2][1]:
  ans=1
if m[0][0]-m[0][2]!=m[1][0]-m[1][2]:
  ans=1
if m[0][0]-m[0][2]!=m[2][0]-m[2][2]:
  ans=1
print("YNeos"[ans::2])

Buggy submission (verdict: Runtime Error):
m=[list(map(int,input().split()))for i in range(3)]
ans=1
if m[0][0]-m[1][0]!=m[0][1]-m[1][1]:
  ans=0
if m[0][0]-m[1][0]!=m[0][2]-m[1][2]:
  ans=0
if m[0][0]-m[2][0]!=m[0][1]-m[2][1]:
  ans=0
if m[0][0]-m[2][0]!=m[0][2]-m[2][2]:
  ans=0
if m[0][0]-m[0][1]!=m[1][0]-m[1][1]:
  ans=0
if m[0][0]-m[0][1]!=m[2][0]-m[2][1]:
  ans=0
if m[0][0]-m[0][2]!=m[1][0]-m[1][2]:
  ans=0
if m[0][0]-m[0][2]!=m[2][0]-m[2][2]:
  ans=0
print("YNeos"[and::2])
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
n=int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    if 500*i+100*j>n:
      break
    else:
      if(n-500*i-100*j)%50==0 and (n-500*i-100*j)//50<=c:
        ans+=1
  if 500*i>n:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
n=int(input())
ans=0
for i in range(a):
  for j in range(b):
    if 500*i+100*j>n:
      break
    else:
      (n-500*i-100*j)%50==0 and (n-500*i-100*j)//50<=c:
        ans+=1
  if 500*i>n:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
n=6000
ans=0
for i in range(1000):
  for j in range(1000):
    if 500*i+100*j>n:
      break
    else:
      (n-500*i-100*j)%50==0:
        ans+=1
  if 500*i>n:
    break
print(ans)
Problem p03456 (python)

Fixed submission:
print("NYoe s"[int(input().replace(" ",""))**0.5%1==0::2])

Buggy submission (verdict: Runtime Error):
print("NYoe s"[int(input().replace(" ",""))**0.5.isinteger()::2])

Buggy submission (verdict: Runtime Error):
print("NYoe s"[int(input().replace(" ","")).isinteger()::2])
Problem p03469 (python)

Fixed submission:
a=input()

print(a[:3]+'8'+a[4:])

Buggy submission (verdict: Runtime Error):
a=input()
a[3]='8'
print(a)
Problem p03470 (python)

Fixed submission:
n=int(input())
d={input():1for i in range(n)}
print(sum(d.values()))

Buggy submission (verdict: Runtime Error):
n=int(input())
{input():1for i in range(n)}
print(sum({input():1for i in range(n)}.values()))

Buggy submission (verdict: Runtime Error):
n=int(input())
d={input();1for i in range(n)}
print(sum(d.values()))
Problem p03474 (python)

Fixed submission:
a,b=map(int,input().split())
s=input()
if s.count("-")<2 and s[a]=="-":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());s=input();print("YNeos"[len(s)<11*s[a]=="-"::2])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());s=input();print(""[len(s)<11*s[a]=="-"::2]
Problem p03475 (python)

Fixed submission:
n=int(input())
m=[]
for _ in range(n-1):
  c,s,f=map(int,input().split())
  m.append(0)
  for i in range(len(m)):
    if m[i]>s:
      m[i]=s+((m[i]-s)//f+((m[i]-s)%f>0))*f+c
    else:#m[i]<=s
      m[i]=s+c
m.append(0)
for i in m:
  print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())
m=[]
for c,s,f in map(int,input().split()):
  m.append(0)
  for i in range(len(m)):
    if m[i]>s:
      m[i]=s+((m[i]-s)//f+((m[i]-s)%f>0))*f+c
    else:#m[i]<=s
      m[i]=s+c
m.append(0)
for i in m:
  print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[list(map(int,input().split()))for i in range(n-1)]
for i in range(n-1):
  t=0
  for j in range(j,n-1):
    if t<l[j][1]:
      t=l[j][1]
    if t%l[j][2]!=0:
      t=(t%l[j][2]+1)*l[j][2]
    t+=l[j][0]
  print(t)
print(0)
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
  t=i%10+i//10%10+i//100%10+i//1000%10+i//10000
  
  if a<=t<=b:
    ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input())
ans=0
for i in range(n):
  t=0
  i1=i
  for j in range(i):
    t+=i1%10
    i1//10
    if i1==0:
      break
  if a<=t<=b:
    ans+=i
print(ans)
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,ieput().split())
print((a+b)//2+(a+b)%2)
Problem p03486 (python)

Fixed submission:
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if i==len(b):
    print("No")
    break
  if i==len(a):
    print("Yes")
    break
  if m[i]<n[i]:
    print("Yes")
    break
  if m[i]>n[i]:
    print("No")
    break
  i+=1

Buggy submission (verdict: Runtime Error):
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if i==len(b):
    print("No")
    break
  if m[i]<n[i] or i==len(a):
    print("Yes")
    break
  i+=1

Buggy submission (verdict: Runtime Error):
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort()
i=0
while 1>0:
  if m[i]<n[i]:
    print("Yes")
    break
  if i==len(a) or i==len(b):
    print("No")
    break
  i+=1