Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
nod=[[]]
check=[[0,0]]
for i in range(n-1):
  nod.append([])
  check.append([10**10,0])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)


def dfs(k):
  count=check[k-1][0]+1
  uselist=nod[k-1]
  for x in uselist:
    if count<check[x-1][0]:
      check[x-1][0]=count
      check[x-1][1]=k
      dfs(x)
    else:
      continue
  return

dfs(1)
print("Yes")
for i in range(n-1):
  print(check[i+1][1])

Fixed submission:
from collections import deque
dic={}
n,m=map(int,input().split())
nod=[[]]
keep=[0]*n
for i in range(n-1):
  nod.append([])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)
use=deque()
use.append(1)
for i in range(0,10**100):
  if bool(use):
    sss=use.popleft()
    for j in nod[sss-1]:
      if not j in dic:
        keep[j-1]=sss
        use.append(j)
        dic[j]=1
  else:
    break

keep.pop(0)
print("Yes")
for x in keep:
  print(x)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
nod=[[]]
check=[[0,0]]
for i in range(n-1):
  nod.append([])
  check.append([10**10,0])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)


def dfs(k):
  count=check[k-1][0]+1
  uselist=nod[k-1]
  for x in uselist:
    if count<check[x-1][0]:
      check[x-1][0]=count
      check[x-1][1]=k
      dfs(x)
    else:
      continue

dfs(1)
print("Yes")
for i in range(n-1):
  print(check[i+1][1])

Fixed submission:
from collections import deque
dic={}
n,m=map(int,input().split())
nod=[[]]
keep=[0]*n
for i in range(n-1):
  nod.append([])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)
use=deque()
use.append(1)
for i in range(0,10**100):
  if bool(use):
    sss=use.popleft()
    for j in nod[sss-1]:
      if not j in dic:
        keep[j-1]=sss
        use.append(j)
        dic[j]=1
  else:
    break

keep.pop(0)
print("Yes")
for x in keep:
  print(x)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
nod=[[]]
check=[[0,0]]
for i in range(n-1):
  nod.append([])
  check.append([10**10,0])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)


def dfs(k):
  count=check[k-1][0]+1
  uselist=nod[k-1]
  for x in uselist:
    if count<check[x-1][0]:
      check[x-1][0]=count
      check[x-1][1]=k
      dfs(x)
    else:
      continue

dfs(1)
for i in range(n-1):
  print(check[i+1][1])

Fixed submission:
from collections import deque
dic={}
n,m=map(int,input().split())
nod=[[]]
keep=[0]*n
for i in range(n-1):
  nod.append([])
for i in range(m):
  a,b=map(int,input().split())
  nod[a-1].append(b)
  nod[b-1].append(a)
use=deque()
use.append(1)
for i in range(0,10**100):
  if bool(use):
    sss=use.popleft()
    for j in nod[sss-1]:
      if not j in dic:
        keep[j-1]=sss
        use.append(j)
        dic[j]=1
  else:
    break

keep.pop(0)
print("Yes")
for x in keep:
  print(x)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())

if k>=a+b+c:
  print(a-c):
elif a+b<=k<=a+b+c:
  print(a-(k-(a+b)))
elif a<=k<=a+b:
  print(a)
elif 0<=k<=a:
  print(k)

Fixed submission:
a,b,c,k=map(int,input().split())

if k>=a+b+c:
  print(a-c)
elif a+b<=k<=a+b+c:
  print(a-(k-(a+b)))
elif a<=k<=a+b:
  print(a)
elif 0<=k<=a:
  print(k)
Buggy python submission (verdict: Runtime Error):
x=int(input())
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5-j**5==x:
      print(i,j)
      keep=1
      break
  if keep==1:
    break

Fixed submission:
x=int(input())
keep=0
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5-j**5==x:
      print(i,j)
      keep=1
      break
  if keep==1:
    break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
minus=[]
res=0
for i in range(0,n):
  minus.append(i-a[i])
for i in range(0,n):
  res+=minus.count(i+a[i])
print(res)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
minus={}
plus={}
res=0
for i in range(0,n):
  pp=a[i]
  if i-pp in minus:
    minus[i-pp]+=1
  else:
    minus[i-pp]=1
  if i+pp in plus:
    plus[i+pp]+=1
  else:
    plus[i+pp]=1
for j in range(len(minus)):
  t=minus.popitem()
  try:
    res+=t[1]*plus[t[0]]
  except KeyError:
    pass
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
pluslist=[]
minuslist=[]
res=0
for i in range(0,n):
  pluslist.append(a[i]+i)
  minuslist.append(i-a[i])
for i in range(0,n):
  res+=minuslist.count(pluslist[i])
print(res)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
minus={}
plus={}
res=0
for i in range(0,n):
  pp=a[i]
  if i-pp in minus:
    minus[i-pp]+=1
  else:
    minus[i-pp]=1
  if i+pp in plus:
    plus[i+pp]+=1
  else:
    plus[i+pp]=1
for j in range(len(minus)):
  t=minus.popitem()
  try:
    res+=t[1]*plus[t[0]]
  except KeyError:
    pass
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=map(int,input().split())
x_kouho=[]
count=1
while count<=n//b:
  x_kouho.append(b*count-1)
  count+=1
if not x_kouho:
  x_kouho.append(n)

res=0
for i in range(0,len(x_kouho)):
  keep=x_kouho[i]
  kept=(a*keep)//b-a*(keep//b)
  if kept>res:
    res=kept
print(res)

Fixed submission:
a,b,n=map(int,input().split())
x_kouho=[]
count=1
if b==1:
  res=0
else:
  while count<=n//b:
    x_kouho.append(b*count-1)
    count+=1
  if not x_kouho:
    x_kouho.append(n)

  res=0
  for i in range(0,len(x_kouho)):
    keep=x_kouho[i]
    kept=(a*keep)//b-a*(keep//b)
    if kept>res:
      res=kept
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
dic={}
cur=0
power=1
for i in range(0,len(s)+1):
  s_int=len(s)-i-1
  if cur in dic:
    dic[cur]+=1
  else:
    dic[cur]=1
  try:
    num=int(s[s_int])
    cur+=num*10**power
    cur%=2019
    power+=1
  except IndexError:
    break

res=0
for i in range(len(dic)):
  t=dic.popitem()
  cc=t[1]
  res+=cc*(cc-1)//2
print(res)


Fixed submission:
s=input()
dic={}
cur=0
power=0
for i in range(0,len(s)+1):
  s_int=len(s)-i-1
  if cur in dic:
    dic[cur]+=1
  else:
    dic[cur]=1
  try:
    num=int(s[s_int])
    cur+=num*pow(10,power,2019)
    cur%=2019
    power+=1
  except IndexError:
    break

res=0
for i in range(len(dic)):
  t=dic.popitem()
  cc=t[1]
  res+=cc*(cc-1)//2
print(res)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

jyoshi=[0]*n
for i in range(n-1):
  jyo=a[i]
  jyoshi[jyo-1]=jyoshi[jyo-1]+1
  
for k in jyoshi:
  print k


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

jyoshi=[0]*n
for i in range(n-1):
  jyo=a[i]
  jyoshi[jyo-1]=jyoshi[jyo-1]+1
  
for k in jyoshi:
  print(k)
Buggy python submission (verdict: Runtime Error):
n = int(input)
count = 0
tenwari = n%10
baiwari = n%100
ichi = tenwari
jyu = (baiwari-tenwari)//10
hyaku = (n-jyu*10-ichi)//100

if ichi != 7:
  count = count + 1
if jyu != 7:
  count = count + 1
if hyaku != 7:
  count = count + 1
  
if count ==0:
  print('Yes')
else:
  print('No')


Fixed submission:
n = int(input())
count = 0
tenwari = n%10
baiwari = n%100
ichi = tenwari
jyu = (baiwari-tenwari)//10
hyaku = (n-jyu*10-ichi)//100

if ichi != 7:
  count = count + 1
if jyu != 7:
  count = count + 1
if hyaku != 7:
  count = count + 1
  
if count == 3:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
n = int(input)
keta = n//10 + 1
count = 0
for i in range(0, keta):
  if n[i] == 7:
    count = count
  else:
    count = count + 1
    
if count == keta:
  print('No')
else:
  print('Yes')


Fixed submission:
n = int(input())
count = 0
tenwari = n%10
baiwari = n%100
ichi = tenwari
jyu = (baiwari-tenwari)//10
hyaku = (n-jyu*10-ichi)//100

if ichi != 7:
  count = count + 1
if jyu != 7:
  count = count + 1
if hyaku != 7:
  count = count + 1
  
if count == 3:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
n = int(input)
count = 0
for i in range(0,n):
  if (i+1)%3==0:
    count = count
  elif (i+1)%5==0:
    count = count
  else:
    count = count + i + 1

print(count)


Fixed submission:
n = int(input())
count = 0
for i in range(0,n):
  if (i+1)%3==0:
    count = count
  elif (i+1)%5==0:
    count = count
  else:
    count = count + i + 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input)
count = 0
for i in range(0,n):
  if (i+1)//3==0:
    count = count
  elif (i+1)//5==0:
    count = count
  else:
    count = count + i + 1

print(count)


Fixed submission:
n = int(input())
count = 0
for i in range(0,n):
  if (i+1)%3==0:
    count = count
  elif (i+1)%5==0:
    count = count
  else:
    count = count + i + 1

print(count)
Buggy python submission (verdict: Runtime Error):
k = int(input())
import math
k1 = 0
k2 = 0
k3 = 0
count = 0
for i in range(0,k):
  k1 = k1 + 1
  for j in range(0,i):
    k2 = k2 + 1
    for k in range(0, j):
      k3 = k3 + 1
      if k1==k2==k3:
        count = count + k1
      elif k1==k2 or k2==k3 or k3==k1:
        count = count + 3*math.gcd(k1,k2,k3)
      else:
        count = count + 6*math.gcd(k1,k2,k3)

Fixed submission:
k = int(input())
import math
k1 = 0
k2 = 0
k3 = 0
count = 0
for i in range(0,k):
  k1 = k1 + 1
  k2 = 0
  for j in range(0,k1):
    k3=0
    k2 = k2 + 1
    for k in range(0, k2):
      k3 = k3 + 1
      if k1==k2==k3:
        count = count + k1
      elif k1==k2:
        count = count + 3*math.gcd(k1,k3)
      elif k2==k3:
        count = count + 3*math.gcd(k1,k2)
      elif k3==k1:
        count = count + 3*math.gcd(k1,k2)
      else:
        k4 = math.gcd(k1,k2)
        count = count + 6*math.gcd(k3,k4)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())

def largest(a,b,c):
  if a <= b:
    if a<= c:
      return a
    else:
      return c
  else:
    if b<=c:
      return b
    else:
      return c
    
def absol(d):
  if d < 0:
    return -d
  else:
    return d
    
def dist(i,j):
  return largest(j-i, absol(x-i) + absol(y-j) + 1, absol(x-j) + absol(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in listlist:
  print(k)


Fixed submission:
n,x,y = map(int,input().split())

def dist(i,j):
  return min(j-i, abs(x-i) + abs(y-j) + 1, abs(x-j) + abs(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in listlist:
  print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())

def largest(a,b,c):
  if a <= b:
    if a<= c:
      return a
    else:
      return c
  else:
    if b<=c:
      return b
    else:
      return c
    
def absol(d):
  if d < 0:
    return -d
  else:
    return d
    
def dist(i,j):
  return largest(j-i, absol(x-i) + absol(y-j) + 1, absol(x-j) + absol(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in range(0, n-1):
  print(listlist[k])
  

Fixed submission:
n,x,y = map(int,input().split())

def dist(i,j):
  return min(j-i, abs(x-i) + abs(y-j) + 1, abs(x-j) + abs(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in listlist:
  print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())

def largest(a,b,c):
  if a <= b:
    if a<= c:
      return a
    else:
      return c
  else:
    if b<=c:
      return b
    else:
      return c
    
def absol(d):
  if d < 0:
    return -d
  else:
    return d
    
def dist(i,j):
  return largest(j-i, absol(x-i) + absol(y-j) + 1, absol(x-j) + absol(y-i) + 1)

listlist = []
for t in range(1,n):
  listlist.append([t,0])

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1][1] = listlist[distance-1][1] + 1

for t in range(0,n-1):
  print(listlist[t][1])


Fixed submission:
n,x,y = map(int,input().split())

def dist(i,j):
  return min(j-i, abs(x-i) + abs(y-j) + 1, abs(x-j) + abs(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in listlist:
  print(k)
Buggy python submission (verdict: Runtime Error):
print(["Yes","No"][input()=="BBB"or"AAA"])

Fixed submission:
s=input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
keep=1
for i in range(q):
  lis=list(map(str,input().split()))
  if lis[0]=="1":
    keep*=-1
  elif lis[1]=="1":
    if keep==1:
      s=lis[2]+s
    else:
      s+=lis[2]
  else:
    if keep==1:
      s+=lis[2]
    else:
      s=lis[2]+s

if keep==1:
  print(s)
else:
  print(s[::-1])

Fixed submission:
s=input()
q=int(input())
keep=1
mae=""
ato=""
for i in range(q):
  lis=list(map(str,input().split()))
  if lis[0]=="1":
    keep*=-1
  elif lis[1]=="1":
    if keep==1:
      mae=lis[2]+mae
    else:
      ato+=lis[2]
  else:
    if keep==1:
      ato+=lis[2]
    else:
      mae=lis[2]+mae

if keep==1:
  print(mae+s+ato)
else:
  print(ato[::-1]+s[::-1]+mae[::-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
for i in range(q):
  lis=list(map(str,input().split()))
  if lis[0]=="1":
    s=s[::-1]
  elif lis[1]=="1":
    s=lis[2]+s
  else:
    s+=lis[2]

print(s)

Fixed submission:
s=input()
q=int(input())
keep=1
mae=""
ato=""
for i in range(q):
  lis=list(map(str,input().split()))
  if lis[0]=="1":
    keep*=-1
  elif lis[1]=="1":
    if keep==1:
      mae=lis[2]+mae
    else:
      ato+=lis[2]
  else:
    if keep==1:
      ato+=lis[2]
    else:
      mae=lis[2]+mae

if keep==1:
  print(mae+s+ato)
else:
  print(ato[::-1]+s[::-1]+mae[::-1])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
keep=0
aa=["#"]*n
for i in range(m):
  s,c=map(str,input().split())
  s=int(s)
  if n>=2 and s==1 and c=="0":
    keep=1
    print(-1)
    break
  if aa[s-1]=="#":
    aa[s-1]=c
  elif aa[s-1] !=c:
    keep=1
    print(-1)
    break
if keep==0:
  moji=""
  if aa[0]=="#" and n>=2:
    moji+="1"
  elif n==1 and aa[0]=="#":
    moji+="0"
  else:
    moji+=aa[0]
  for i in range(1,n):
    if aa[i]=="#":
      moji+="0"
    else:
      moji+=aa[i]
  print(moji)

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

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

Fixed submission:
s=int(input())
if s%2==0:
  print(s//2)
else:
  print(s//2+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
keep=0
aa=["#"]*n
for i in range(m):
  s,c=map(str,input().split())
  s=int(s)
  if aa[s-1]=="#":
    aa[s-1]=c
  elif aa[s-1] !=c:
    keep=1
    print(-1)
    break
if keep==0:
  moji=""
  if aa[0]=="#":
    moji+="1"
  else:
    moji+=aa[0]
  for i in range(1,n):
    if aa[i]=="#":
      moji+="0"
    else:
      moji+=aa[i]
print(moji)

Fixed submission:
n,m=map(int,input().split())
keep=0
aa=["#"]*n
for i in range(m):
  s,c=map(str,input().split())
  s=int(s)
  if n>=2 and s==1 and c=="0":
    keep=1
    print(-1)
    break
  if aa[s-1]=="#":
    aa[s-1]=c
  elif aa[s-1] !=c:
    keep=1
    print(-1)
    break
if keep==0:
  moji=""
  if aa[0]=="#" and n>=2:
    moji+="1"
  elif n==1 and aa[0]=="#":
    moji+="0"
  else:
    moji+=aa[0]
  for i in range(1,n):
    if aa[i]=="#":
      moji+="0"
    else:
      moji+=aa[i]
  print(moji)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

count = 0
list00 = []
for i in range(0,n):
  if a[i] in list00:
    count = count
  else:
    count = count + 1
    list00.append(a[i])
if count == n:
  print('YES')
else:
  print('NO')
  

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

count = 0
list00 = sorted(a)
for i in range(1, n):
  if list00[i-1] == list00[i]:
    count = count*0
  else:
    count = count + 1

if count == n-1:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
for j in range(0, k-1):
  p[j]=(p[j]+1)*p[j]/(p[j]*2)#p[i]が期待値になった
list00=[]
for i in range(k-1, n):
  p[i]=(p[i]+1)*p[i]/(p[i]*2)#p[i]が期待値になった
  list00.append(sum(p[i-k+1:i+1]))
list00.sort()
print(list00[n-k])


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

kouho=0
lis=[0]*n
lis[0]=(1+p[0])/2
for i in range(0,n):
  if i>=1:
    lis[i]=lis[i-1]+(1+p[i])/2
  if i==k-1:
    kouho=lis[i]
  if i>k:
    if lis[i]-lis[i-k]>kouho:
      kouho=lis[i]-lis[i-k]
print(kouho)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

for i in range(0, n):
  p[i]=(p[i]+1)*p[i]/(p[i]*2)#p[i]が期待値になった

list00=[]
for j in range(0, n-k+1):
  list00.append(sum(p[j:j+k]))

y = sorted(list00)
print(y[n-k])


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

kouho=0
lis=[0]*n
lis[0]=(1+p[0])/2
for i in range(0,n):
  if i>=1:
    lis[i]=lis[i-1]+(1+p[i])/2
  if i==k-1:
    kouho=lis[i]
  if i>k:
    if lis[i]-lis[i-k]>kouho:
      kouho=lis[i]-lis[i-k]
print(kouho)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

for i in range(0, n):
  p[i]=(p[i]+1)*p[i]/(p[i]*2)#p[i]が期待値になった

m = 0
for j in range(0, n-k+1):
  if m>=sum(p[j:j+k]):
    m = m
  else:
    m = sum(p[j:j+k])

print(m)


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

kouho=0
lis=[0]*n
lis[0]=(1+p[0])/2
for i in range(0,n):
  if i>=1:
    lis[i]=lis[i-1]+(1+p[i])/2
  if i==k-1:
    kouho=lis[i]
  if i>k:
    if lis[i]-lis[i-k]>kouho:
      kouho=lis[i]-lis[i-k]
print(kouho)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

def one_n_sum(x):
  return (1+x)*x//2

list00 = []
for i in range(0, n):
  list00.append(one_n_sum(p[i])/p[i])

def larger(x,y):
  if x>=y:
    return x
  else:
    return y

m = 0
for j in range(0, n-k+1):
  m_cal = sum(list00[j:j+k])
  m = larger(m,m_cal)
  
print(m)


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

kouho=0
lis=[0]*n
lis[0]=(1+p[0])/2
for i in range(0,n):
  if i>=1:
    lis[i]=lis[i-1]+(1+p[i])/2
  if i==k-1:
    kouho=lis[i]
  if i>k:
    if lis[i]-lis[i-k]>kouho:
      kouho=lis[i]-lis[i-k]
print(kouho)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
for i in range(k):
  try:
    h.pop(0)
  except IndexError:
    pass
print(sum(h))

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
for i in range(k):
  try:
    h.pop(0)
  except IndexError:
    pass
print(sum(h)+t)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h = set(map(int,input().split()))

h = sorted(h)
l = len(h)
for i in range(l-k,l):
  h[i] = 0
  
result = 0  
for j in range(0, l):
  result = result + h[j]
print(result)


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h = set(map(int,input().split()))

h = sorted(h)
l = len(h)
if k != 0:
  for i in range(l-k,l):
    h[i] = 0
  
result = 0  
for j in range(0, l):
  result = result + h[j]
print(h)
print(result)


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h = set(map(int,input().split()))

h = sorted(h)
l = len(h)
for i in range(l-k,l):
  h[i] = 0
  
result = sum(h)
print(result)


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))

m=2*(10**5)+1
count = 0
for i in range(0, n):
  if p[i] <= m:
    m = p[i]
    count = count + 1

print(count)

Fixed submission:
n,m=map(int,input().split())
if n == m:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n,m = map(int(input().split()))
if n == m:
  print'Yes'
else:
  print'No'

Fixed submission:
n,m=map(int,input().split())
if n == m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))

def smaller(x, y):
    if x>y:
        return y
    else:
        return x

def minimum(score):
    m = score[0]
    for i in range(1, len(score)):
        m = smaller(m, score[i])
    return m

count = 1
for i in range(1, n):
  if p[i]==minimum(p[0:i+1]):
    count = count + 1
print(count)

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

m=2*(10**5)+1
count = 0
for i in range(0, n):
  if p[i] <= m:
    m = p[i]
    count = count + 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))

count = 0
count_i = 0
for i in range(0, n):
  for j in range(0, i+1):
    if p[i]<=p[j]:
      count_i=count_i + 1
  if count_i == i+1:
    count = count + 1
  count_i = 0

print(count)


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

m=2*(10**5)+1
count = 0
for i in range(0, n):
  if p[i] <= m:
    m = p[i]
    count = count + 1

print(count)
Buggy python 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()))

lis=[]
for i in range(0,n-1):
  if a[i]==a[i+1]-1:
    lis.append(a[i])
plus=0
for j in range(0,len(lis)):
  plus+=c[a[j]-1]
print(sum(b)+plus)

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

lis=[]
for i in range(0,n-1):
  if a[i]==a[i+1]-1:
    lis.append(a[i])
plus=0
for j in range(0,len(lis)):
  plus+=c[lis[j]-1]
print(sum(b)+plus)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
count=0
dd=[]
for i in range(n):
  s=input()
  dic={}
  for j in range(0,10):
    k=s[j]
    if k in dic:
      dic[k]+=1
    else:
      dic[k]=1
  
  count+=dd.count(dic)
  dd.append(dic)
print(count)

Fixed submission:
n=int(input())
count=0
dic={}
ppp=""
for i in range(n):
  s=list(input())
  s.sort()
  s=ppp.join(s)
  if s in dic:
    dic[s]+=1
  else:
    dic[s]=1
kouho=0
for j in range(len(dic)):
  kk=dic.popitem()
  c=kk[1]
  kouho+=(c*(c-1))//2
print(kouho)
Buggy python submission (verdict: Runtime Error):
a,p=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")