Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*m
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
if ans==999999999999999999:
  print(-1)
else:
  print(ans)

Fixed submission:
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*n
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
if ans==999999999999999999:
  print(-1)
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*m
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
print(ans)

Fixed submission:
n,m,x=map(int,input().split())
ans=999999999999999999
a=[0]*n
for i in range(n):
  a[i]=list(map(int,input().split()))
for i in range(2**n):
  t=[0]*m
  temp=0
  for j in range(n):
    if (i>>j)&1:
      temp=temp+a[j][0]
      for k in range(m):
        t[k]=t[k]+a[j][k+1]
  if min(t)>=x:
    ans=min(ans,temp)
if ans==999999999999999999:
  print(-1)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if S=="ABC":
    print("ARC")
elsse:
    print("ABC")

Fixed submission:
S = input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    for j in range(1,n+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)

Fixed submission:
n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    A.append(-100)
    for j in range(1,n+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=0
tempi=[0]*n
tempj=[0]*n
for i in range(n):
  tempi[i]=a[i]+i+1
for i in range(n):
  tempj[i]=-a[i]+i+1
for i in range(n):
  ans=ans+tempj.count(tempi[i])
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
tempi=[0]*n
tempj=[0]*n
for i in range(n):
  tempi[i]=a[i]+i+1
for i in range(n):
  tempj[i]=-a[i]+i+1
import collections
tempid=collections.Counter(tempi)
tempjd=collections.Counter(tempj)
for k in tempid.keys():
  a=tempid[k]
  b=tempjd[k]
  ans=ans+a*b
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
num=0
for i in range(0,n):
    if a[i]+1<n-i:
        for j in range(max(i+1,a[i]+1),n):
            if a[i]+a[j]==j-i:
                num=num+1
print(num)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
tempi=[0]*n
tempj=[0]*n
for i in range(n):
  tempi[i]=a[i]+i+1
for i in range(n):
  tempj[i]=-a[i]+i+1
import collections
tempid=collections.Counter(tempi)
tempjd=collections.Counter(tempj)
for k in tempid.keys():
  a=tempid[k]
  b=tempjd[k]
  ans=ans+a*b
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
num=0
for i in range(0,n):
    for j in range(max(i+1,a[i]+1),n):
        if a[i]+a[j]==j-i:
            num=num+1
print(num)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
tempi=[0]*n
tempj=[0]*n
for i in range(n):
  tempi[i]=a[i]+i+1
for i in range(n):
  tempj[i]=-a[i]+i+1
import collections
tempid=collections.Counter(tempi)
tempjd=collections.Counter(tempj)
for k in tempid.keys():
  a=tempid[k]
  b=tempjd[k]
  ans=ans+a*b
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
num=0
for i in range(0,n):
    for j in range(i+1,n):
        if a[i]+a[j]==j-i:
            num=num+1
print(num)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
tempi=[0]*n
tempj=[0]*n
for i in range(n):
  tempi[i]=a[i]+i+1
for i in range(n):
  tempj[i]=-a[i]+i+1
import collections
tempid=collections.Counter(tempi)
tempjd=collections.Counter(tempj)
for k in tempid.keys():
  a=tempid[k]
  b=tempjd[k]
  ans=ans+a*b
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[]
for i in range(n):
  s[i]=str(input())
s=list(set(s))
print(len(s))

Fixed submission:
n=int(input())
s=[0]*n
for i in range(n):
  s[i]=str(input())
s=list(set(s))
print(len(s))
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
from math import gcd
ans=0
for i in range(1,k+1):
  for j in range(1,k+1):
    for m in range(1,k+1):
      temp=gcd(i,j)
      ans=ans+gcd(temp,m)
print(ans)


Fixed submission:
k=int(input())
from math import gcd
ans=0
for i in range(1,k+1):
  for j in range(1,k+1):
    temp=gcd(i,j)
    for m in range(1,k+1):
      ans=ans+gcd(temp,m)
print(ans)
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+a[n-1]
for i in range(1,n):
  temp=max(temp,a[i]-i[i-1])
print(k-temp)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+k-a[n-1]
for i in range(1,n):
  temp=max(temp,a[i]-a[i-1])
print(k-temp)

Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+a[n-1]
for i in range(1,n):
  temp=max(ans,a[i]-i[i-1])
print(k-temp)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
temp=a[0]+k-a[n-1]
for i in range(1,n):
  temp=max(temp,a[i]-a[i-1])
print(k-temp)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
temp=[0]*n
for i in range(n):
  temp[i]=a.count(a[i])-1
ans=sum(temp)//2
for i in range(n):
  print(ans-temp[i])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
tempa=Counter(a)
temp=[0]*n
for i in range(n):
  temp[i]=tempa[a[i]]-1
ans=sum(temp)//2
for i in range(n):
  print(ans-temp[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
temp=[0]*n
for i in range(n):
  cnt=0
  for j in range(n):
    if a[i]==a[j]:
      cnt=cnt+1
  temp[i]=cnt-1
ans=sum(temp)//2
for i in range(n):
  print(ans-temp[i])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
tempa=Counter(a)
temp=[0]*n
for i in range(n):
  temp[i]=tempa[a[i]]-1
ans=sum(temp)//2
for i in range(n):
  print(ans-temp[i])
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[0]*h
t=[0]*h
for i in range(h):
  st=str(input())
  st=list(st)
  s[i]=st
  tt=[0]*w
  t[i]=tt
if s[0][0]=="#":
  t[0][0]=1
for i in range(1,w):
  t[i][0]=t[i-1][0]
  if s[i][0]=="#":
    t[i][0]=t[i-1][0]+1
for i in range(1,h):
  t[0][i]=t[0][i-1]
  if s[0][i]=="#":
    t[0][i]=t[0][i-1]+1
for i in range(1,h):
  for j in range(1,w):
    t[j][i]=min(t[j-1][i],t[j][i-1])
    if s[j][i]=="#":
      t[j][i]=t[j][i-1]+1
print(t[w-1][h-1])

Fixed submission:
h,w=map(int,input().split())
s=[0]*h
t=[0]*h
for i in range(h):
  st=str(input())
  st=list(st)
  s[i]=st
  tt=[0]*w
  t[i]=tt
if s[0][0]=="#":
  t[0][0]=1
for i in range(1,h):
  t[i][0]=t[i-1][0]
  if s[i-1][0]=="." and s[i][0]=="#":
    t[i][0]=t[i-1][0]+1
for i in range(1,w):
  t[0][i]=t[0][i-1]
  if s[0][i-1]=="." and s[0][i]=="#":
    t[0][i]=t[0][i-1]+1
for i in range(1,w):
  for j in range(1,h):
    if s[j-1][i]=="." and s[j][i]=="#":
      t1=t[j-1][i]+1
    else:
      t1=t[j-1][i]
    if s[j][i-1]=="." and s[j][i]=="#":
      t2=t[j][i-1]+1
    else:
      t2=t[j][i-1]
    t[j][i]=min(t1,t2)
print(t[h-1][w-1])
Buggy python submission (verdict: Runtime Error):
a,b,m=map(int,input().split())
at=list(map(int,input().split()))
bt=list(map(int,input().split()))
ans=min(at)+min(bt)
for i in range(m):
  x,y,c=map(int,input().split())
  ans=min(ans,at[x-1]+bt[y-1]-c)
print(ans)
v

Fixed submission:
a,b,m=map(int,input().split())
at=list(map(int,input().split()))
bt=list(map(int,input().split()))
ans=min(at)+min(bt)
for i in range(m):
  x,y,c=map(int,input().split())
  ans=min(ans,at[x-1]+bt[y-1]-c)
print(ans)
Buggy python submission (verdict: Runtime Error):
a=[]
for i in range(3):
  a1,a2,a3=map(int,input().split())
  a.append(a1,a2,a3)
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(9):
    if a[j]==b:
      a[j]=0
if a[0]==0 and a[1]==0 and a[2]==0:
  print("Yes")
elif a[3]==0 and a[4]==0 and a[5]==0:
  print("Yes")
elif a[6]==0 and a[7]==0 and a[8]==0:
  print("Yes")
elif a[0]==0 and a[3]==0 and a[6]==0:
  print("Yes")
elif a[1]==0 and a[4]==0 and a[7]==0:
  print("Yes")
elif a[2]==0 and a[5]==0 and a[8]==0:
  print("Yes")
elif a[0]==0 and a[4]==0 and a[8]==0:
  print("Yes")
elif a[2]==0 and a[4]==0 and a[6]==0:
  print("Yes")
else:
  print("No")

Fixed submission:
a=[]
for i in range(3):
  a1,a2,a3=map(int,input().split())
  a.append(a1)
  a.append(a2)
  a.append(a3)
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(9):
    if a[j]==b:
      a[j]=0
if a[0]==0 and a[1]==0 and a[2]==0:
  print("Yes")
elif a[3]==0 and a[4]==0 and a[5]==0:
  print("Yes")
elif a[6]==0 and a[7]==0 and a[8]==0:
  print("Yes")
elif a[0]==0 and a[3]==0 and a[6]==0:
  print("Yes")
elif a[1]==0 and a[4]==0 and a[7]==0:
  print("Yes")
elif a[2]==0 and a[5]==0 and a[8]==0:
  print("Yes")
elif a[0]==0 and a[4]==0 and a[8]==0:
  print("Yes")
elif a[2]==0 and a[4]==0 and a[6]==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=["a"]*n
for i in range(0,m):
  s,c=map(int,input().split())
  if ans[s-1]=="a" or ans[s-1]==c:
    ans[s-1]=c
  else:
    print(-1)
    break
else:
  if i==0 and ans[0]=="a":
    ans[0]=0
  elif ans[0]=="a":
    ans[0]=1
  for i in range(0,n):
    if ans[i]=="a":
      ans[i]=0
  if ans[0]==0:
    print(-1)
  else:
    if n==3:
      ans=int(ans[0])*100+int(ans[1])*10+int(ans[2])
    elif n==2:
      ans=int(ans[0])*10+int(ans[1])
    else:
      ans=int(ans[0])
    print(ans)

Fixed submission:
n,m=map(int,input().split())
ans=["a"]*n
for i in range(0,m):
  s,c=map(int,input().split())
  if ans[s-1]=="a" or ans[s-1]==c:
    ans[s-1]=c
  else:
    print(-1)
    break
else:
  if n==1 and ans[0]=="a":
    ans[0]=0
  elif ans[0]=="a":
    ans[0]=1
  for i in range(0,n):
    if ans[i]=="a":
      ans[i]=0
  if i>=2 and ans[0]==0:
    print(-1)
  else:
    if n==3:
      ans=int(ans[0])*100+int(ans[1])*10+int(ans[2])
    elif n==2:
      ans=int(ans[0])*10+int(ans[1])
    else:
      ans=int(ans[0])
    print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=float("Inf")
for i in range(x[0],x[n-1]+1):
  print(i)
  cal=0
  for j in range(0,n):
    cal=cal+(x[j]-temp)**2
  ans=min(ans,cal)
print(ans)

Fixed submission:
n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=float("Inf")
for i in range(x[0],x[n-1]+1):
  temp=i
  cal=0
  for j in range(0,n):
    cal=cal+(x[j]-temp)**2
  ans=min(ans,cal)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n:
  print("APPROVED")
else:
  print("DENIED")

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n:
  print("APPROVED")
else:
  print("DENIED")

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n
  print("APPROVED")
else:
  print("DENIED")

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      count=count+1
  else:
    count=count+1
if count==n:
  print("APPROVED")
else:
  print("DENIED")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
import numpy as np
p=np.array(p)
ans=0
for i in range(n-k+1):
  temp=p[i:i+k]
  ans=max(ans,sum(temp))
print((ans+k)/2)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
import numpy as np
p=np.array(p)
temp=p[0:k]
tempsum=sum(temp)
ans=tempsum
for i in range(1,n-k+1):
  tempsum=tempsum-p[i-1]+p[i+k-1]
  ans=max(ans,tempsum)
print((ans+k)/2)
Buggy python submission (verdict: Runtime Error):
h,a=map(int,input().split())
if h%a==0:
  print((int(h/a))
else:
  print((int(h/a)+1))

Fixed submission:
h,a=map(int,input().split())
if h%a==0:
  print((int(h/a)))
else:
  print((int(h/a)+1))
Buggy python submission (verdict: Runtime Error):
n=int(input())
b=list(map(int,input().split()))
count=1
temp=[b[0]]
for i in range(1,n):  
  if b[i]==min(b[i],temp):
    count=count+1
    temp=b[i]
print(count)

Fixed submission:
n=int(input())
b=list(map(int,input().split()))
count=1
temp=b[0]
for i in range(1,n):  
  if b[i]==min(b[i],temp):
    count=count+1
    temp=b[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
b=list(map(int,input().split()))
count=1
temp=[b[0]]
for i in range(1,n):
  temp.append(b[i])
  if b[i]==min(temp):
    count=count+1  
print(count)

Fixed submission:
n=int(input())
b=list(map(int,input().split()))
count=1
temp=b[0]
for i in range(1,n):  
  if b[i]==min(b[i],temp):
    count=count+1
    temp=b[i]
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[]
t=[]
for i in range(n):
  st,tt=map(input().split())
  s.append(st)
  t.append(tt)
x=str(input())
ans=0
for i in range(n):
  ans=ans+1
  if t[i]==x:
    break
print(ans)

Fixed submission:
n=int(input())
s=[]
t=[]
for i in range(n):
  st,tt=input().split()
  s.append(st)
  t.append(int(tt))
x=str(input())
temp=0
ans=sum(t)
for i in range(n):
  temp=temp+t[i]
  if s[i]==x:
    break
print(ans-temp)
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  print(min(max(a-1,b-1),max(n-a,n-b))

Fixed submission:
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  temp=min(min(a-1,b-1),min(n-a,n-b))+1  
  print(min(temp+(abs(a-b)-1)//2,min(max(a-1,b-1),max(n-a,n-b))))
Buggy python submission (verdict: Runtime Error):
a=str(input())
a=list(a)
count=0
if a%2 == 0:
  for i in range(0,int(a/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
else:
  for i in range(0,int(a/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
  
print(count)

Fixed submission:
a=str(input())
a=list(a)
count=0
for i in range(0,int(len(a)/2)):
    if a[i]!=a[len(a)-i-1]:
        count=count+1
  
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
xy=[[] for i in range(n)]
ans=0
a=[0]*n
for i in range(n):
  a[i]=int(input())
  for j in range(a[i]):
    x,y=map(int,input().split())
    xy[i].append([x,y])
for i in range(2**n):
  temp=[0]*n
  for j in range(n):
    if ((i >> j) & 1):
      temp[j]=1
  count=True
  for j in range(n):
    for k in range(a[j]):
      if temp[j]==1:
        p=xy[j][k][0]
        if temp[p]!=xy[j][k][0]:
          count=False
      else:
        p=xy[j][k][0]
        if temp[p]==xy[j][k][0]:
          count=False     
  if count==True:
    ans=max(ans,sum(temp))
print(ans)

Fixed submission:
n=int(input())
xy=[[] for i in range(n)]
ans=0
a=[0]*n
for i in range(n):
  a[i]=int(input())
  for j in range(a[i]):
    x,y=map(int,input().split())
    xy[i].append([x,y])
for i in range(2**n):
  temp=[0]*n
  for j in range(n):
    if ((i >> j) & 1):
      temp[j]=1
  count=True
  for j in range(n):
    for k in range(a[j]):
      if temp[j]==1:
        p=xy[j][k][0]-1
        if temp[p]!=xy[j][k][1]:
          count=False
          break
  if count==True:
    ans=max(ans,sum(temp))
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
  if int(temp*1.08)==n:
    print(temp)
    break
else:
  print(":(")

Fixed submission:
n=int(input())
for i in range(1,n+1):
  if i*1.08>=n and i*1.08<n+1:
    print(i)
    break
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(0,9):
  if n%i==0:
    if n/i>=1 and n/i<=9:
      print("Yes")
      break
else:
  print("No")


Fixed submission:
n=int(input())
for i in range(1,10):
  if n%i==0:
    if n/i>=1 and n/i<=9:
      print("Yes")
      break
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(0,9):
  if n%i==0 and n/i>=1 and n/i<=9:
    print("Yes")
    break
else:
  print("No")


Fixed submission:
n=int(input())
for i in range(1,10):
  if n%i==0:
    if n/i>=1 and n/i<=9:
      print("Yes")
      break
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    kmax=n
    kmin=j
    while True:
      k=(kmax+kmin)//2
      if l[i]+l[j]>l[k]:
        ans=ans+k-kmin
        kmin=k
      else:
        kmax=k
      if kmax-kmin==1:
        break
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    kmax=n
    kmin=j
    while True:
      k=(kmax+kmin)//2
      if l[i]+l[j]>l[k]:
        ans=ans+k-kmin
        kmin=k
      else:
        kmax=k
      if kmax-kmin==1:
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]+l[j]>l[k]:
        ans=ans+1
      else:
        break
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    kmax=n
    kmin=j
    while True:
      k=(kmax+kmin)//2
      if l[i]+l[j]>l[k]:
        ans=ans+k-kmin
        kmin=k
      else:
        kmax=k
      if kmax-kmin==1:
        break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
ans=[k]*n
for i in range(q):
  a=int(input())
  for j in range(n):
    if a-1!=j:
      ans[j]=ans[j]-1
for i in range(n):
  if ans[i]<=0:
    print("No")
  else:
    print("Yes")


Fixed submission:
n,k,q=map(int,input().split())
ans=[k-q]*n
a=[0]*q
for i in range(q):
  a[i]=int(input())
for i in range(q):
  ans[a[i]-1]=ans[a[i]-1]+1
for i in range(n):
  if ans[i]<=0:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
for i in range(m):
  a[0]=a[0]/2
  for j in range(1,n):
    if a[0]>a[j]:
      a.insert(j,a[0])
      del a[0]
      break
import math
ans=0
for i in range(n):
  ans=ans+math.floor(a[i])
print(ans)

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

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
for i in range(m):
  a[0]=a[0]/2
  for j in range(1,n):
    if a[0]>a[j]:
      a.insert(j,a[0])
      del a[0]
      break
  print(a)
import math
ans=0
for i in range(n):
  ans=ans+math.floor(a[i])
print(ans)

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

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(m):
  a.sort(reverse=True)
  a[0]=a[0]/2
import math
ans=0
for i in range(n):
  ans=ans+math.floor(a[i])
print(ans)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
  a[i]=a[i]*-1
import heapq
heapq.heapify(a)
for i in range(m):
  t=(heapq.heappop(a))*-1
  heapq.heappush(a,(t//2)*-1)
print(sum(a)*-1)
Buggy python submission (verdict: Runtime Error):
s=str(input())
s=list(s)
ans=1
i=1
temp=s[0]
while True:
  if s[i]!=temp:
    ans=ans+1
    temp=s[i]
    i=i+1
  else:
    temp=s[i]+s[i+1]
    i=i+2
    ans=ans+1
  if i>len(s)-1:
    break
print(ans)

Fixed submission:
s=str(input())
s=list(s)
ans=1
i=1
temp=s[0]
while True:
  if s[i]!=temp:
    ans=ans+1
    temp=s[i]
    i=i+1
  elif s[i]==temp and i==len(s)-1:
    i=i+1
  else:
    temp=s[i]+s[i+1]
    i=i+2
    ans=ans+1
  if i>len(s)-1:
    break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[0]*n
count=0
for i in range(0,n):
  temp=str(input())
  temp=sorted(list(temp))
  temp="".join(temp)
  s[i]=temp
  count=count+s.count(s[i])-1
print(count)

Fixed submission:
n=int(input())
dict={}
count=0
for i in range(0,n):
  temp=str(input())
  temp=sorted(list(temp))
  temp="".join(temp)
  if temp in dict:
    dict[temp]=dict[temp]+1
    count=count+dict[temp]
  else:
    dict[temp]=0
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[0]*n
count=0
for i in range(0,n):
  temp=str(input())
  temp=sorted(list(temp))
  temp="".join(temp)
  s[i]=temp
  for j in range(0,i):
    if s[i]==s[j]:
      count=count+1
print(count)

Fixed submission:
n=int(input())
dict={}
count=0
for i in range(0,n):
  temp=str(input())
  temp=sorted(list(temp))
  temp="".join(temp)
  if temp in dict:
    dict[temp]=dict[temp]+1
    count=count+dict[temp]
  else:
    dict[temp]=0
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
temp=0
if n==1:
  print("Yes")
else:
  for i in h:
    if h[i]<temp:
      print("No")
      break
    temp=max(temp,h[i]-1)
  else:
    print("Yes")

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))
temp=0
if n==1:
  print("Yes")
else:
  for i in range(0,n-1):
    tempmax=min(h[i+1:])
    if h[i]-1>tempmax:
      temp=1
      break
  if temp==0:
    print("Yes")
  else:
    print("No")

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))
temp=0
if n==1:
  print("Yes")
else:
  for i in range(0,n-1):
    for j in range(i+1,n):
      if h[i]-1>h[j]:
        temp=1
        break
  if temp==0:
    print("Yes")
  else:
    print("No")

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
a=[0]*n
for i in range(0,n):
  a[i]=int(input())
temp=copy.copy(a)
for i in range(0,n):
  temp[i]=0
  print(max(temp))
  temp=copy.copy(a)
        

Fixed submission:
n=int(input())
a=[0]*n
for i in range(0,n):
  a[i]=int(input())
temp=sorted(a,reverse=True)
for i in range(0,n):
  if a[i]==temp[0]:
    print(temp[1])
  else:
    print(temp[0])