Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

arr = [int(input()) for _ in range(5)]

br = 0
for r in range(1, 10):
    for i in range(5):
        if((arr[i] % 10) == r):
            last = i
            br = 1
            break
        pass
    if(br == 1):
        break
    pass

time = 0
for i in range(5):
    time += math.ceil(arr[i]/10) * 10

time += arr[last] - math.ceil(arr[last]/10) * 10

print(time)


Fixed submission:
import math

arr = [int(input()) for _ in range(5)]

br = 0
last = 0
for r in range(1, 10):
    for i in range(5):
        if((arr[i] % 10) == r):
            last = i
            br = 1
            break
        pass
    if(br == 1):
        break
    pass

time = 0
for i in range(5):
    time += math.ceil(arr[i]/10) * 10

time += arr[last] - math.ceil(arr[last]/10) * 10

print(time)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a==b==c
	print("Yes")
else
	print("No")

Fixed submission:
a = input().split()
if int(a[0]) == int(a[1]) and int(a[1]) == int(a[2]):
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):

l = map(int, input().split())

if l[0] == l[1] == l[2]
	print("Yes")
else
	print("No")


Fixed submission:
a = input().split()
if int(a[0]) == int(a[1]) and int(a[1]) == int(a[2]):
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
l = input().split()

if l[0] == l[1] and l[1] == l[2]
	print("Yes")
else
	print("No")

Fixed submission:
a = input().split()
if int(a[0]) == int(a[1]) and int(a[1]) == int(a[2]):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):

def isDead(pos):
    nPos = pos
    for magic in td:
        if S[nPos] == magic[0]:
            if magic[1] == 'L':
                nPos -= 1
            else:
                nPos += 1
                pass
            pass

        if (nPos < 0) or (nPos > N-1):
            return True
            pass
        pass # end for
    return False

N, Q = map(int, input().split())
S = input()
td = [input().split() for _ in range(Q)]


left = 0
right = N-1
while(left <= N-1):
    if(isDead(left) == False):
        break
    left += 1
    pass

while(right >= left):
    if(isDead(right) == False):
        break
    right -= 1
    pass
#left   #左側から死んだ数
#N-1 - right  #右側から死んだ数

alive = right - left + 1

print(alive)


Fixed submission:
# ある位置のゴーレムが
# 左端にたどりつくか、右端にたどりつくか、生きているか、を
# 判別する関数
# 戻り値 -1:左端、0:生存、1:右端
def isDead(pos):
    nPos = pos
    if (nPos < 0):
        return -1
    elif (nPos > N-1):
        return 1

    for magic in td:        
        if S[nPos] == magic[0]:
            if magic[1] == 'L':
                nPos -= 1
            else:
                nPos += 1

        if (nPos < 0):
            return -1
        elif (nPos > N-1):
            return 1

        pass # end for
    return 0

N, Q = map(int, input().split())
S = input()
td = [input().split() for _ in range(Q)]

# 二分法で左側の解を求める
lAns = -1
if isDead(0) > -1:
    # 解なし
    lAns = -1
    pass
else:
    tmpMin = -1
    tmpMax = N
    tmp = N // 2
    while( (tmpMax - tmpMin) > 1):
        tmp = (tmpMin + tmpMax) // 2
        if(isDead(tmp) == -1):
            tmpMin = tmp
        else:
            tmpMax = tmp
        pass

    lAns = tmpMin
    # 左側死んだ数 = lAns + 1



# 二分法で右側の解を求める
rAns = N-1
if isDead(N-1) < 1:
    # 解なし
    rAns = N-1
    pass
else:
    tmpMin = -1
    tmpMax = N
    tmp = N // 2
    while( (tmpMax - tmpMin) > 1):
        tmp = (tmpMin + tmpMax) // 2
        if(isDead(tmp) == 1):
            tmpMax = tmp
        else:
            tmpMin = tmp
        pass

    rAns = tmpMin
    # 右側死んだ数 = N - (rAns+1)


alive = rAns - lAns

print(alive)
Buggy python submission (verdict: Runtime Error):
list1=[]
num=int(input())
for i in range (0,num):
	some=input()
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Fixed submission:
list1=[]
num=int(input())
for i in range (0,num):
    list1.append(input())
print(len(set(i for i in list1 if i.isalpha())))

Buggy python submission (verdict: Runtime Error):
num=int(input())
for i in range (0,num):
	some=input()
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Fixed submission:
list1=[]
num=int(input())
for i in range (0,num):
    list1.append(input())
print(len(set(i for i in list1 if i.isalpha())))

Buggy python submission (verdict: Runtime Error):
num=int(input())
for i in range (0,num):
	some=input(list1[])
    list1.append(some)
print(len(set(i for i in list1 if i.isalpha())))

Fixed submission:
list1=[]
num=int(input())
for i in range (0,num):
    list1.append(input())
print(len(set(i for i in list1 if i.isalpha())))

Buggy python submission (verdict: Runtime Error):
num=int(input())
for i in range (0,num):
	some=input(list1[])
    list1.append(some)
print(len(set(i for i in lst if i.isalpha())))

Fixed submission:
list1=[]
num=int(input())
for i in range (0,num):
    list1.append(input())
print(len(set(i for i in list1 if i.isalpha())))
Buggy python submission (verdict: Runtime Error):
s = input()

if s == "SSS":
  print(0)
elif s == "SSR":
  print(1)
elif s == "SRS":
  print(1)
elif s == "SRR":
  prin(2)
elif s == "RSS":
  print(1)
elif s == "RSR":
  print(1)
elif s == "RRS":
  print(2)
elif s == "RRR":
  print(3)

Fixed submission:
s = input()

if "RRR" in s:
  print(3)
elif "RR" in s:
  print(2)
elif "R" in s:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
A = list(map(int, input().split()))

answer = 1
if 0 in A:
    print(0)
else:
    for i in A:
        answer *= i
    if answer > 10**18:
        print(-1)
    else:
        print(answer)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
c_nega = 0
flag = False
for i in range(n):
  if d[i] == 0:
    flag = True
    break

if flag:
  print(0)
else:
  a = 1
  for i in range(n):
    a *= d[i]
    if a > 10**18:
      flag = True
      break
  if flag:
    print(-1)
  else:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = list(map(int, input().split()))
a = 1
flag = False
for i in range(n):
  a *= d[i]
if a > 10**18:
  print(-1)
else:
  print(a)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
c_nega = 0
flag = False
for i in range(n):
  if d[i] == 0:
    flag = True
    break

if flag:
  print(0)
else:
  a = 1
  for i in range(n):
    a *= d[i]
    if a > 10**18:
      flag = True
      break
  if flag:
    print(-1)
  else:
    print(a)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = 1
flag = False
for _ in range(n):
  d = int(input())
  a *= d
  if a > 10**18:
    flag = True
    break
if flag:
  print(-1)
else:
  print(a)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
c_nega = 0
flag = False
for i in range(n):
  if d[i] == 0:
    flag = True
    break

if flag:
  print(0)
else:
  a = 1
  for i in range(n):
    a *= d[i]
    if a > 10**18:
      flag = True
      break
  if flag:
    print(-1)
  else:
    print(a)
Buggy python submission (verdict: Runtime Error):
(defun calc (x a b n)
  (- (floor (/ (* a x) b))
     (* a (floor (/ x b)))))

(let ((a (read))
      (b (read))
      (n (read)))
     (format t "~A" (if (<= b n)
                        (calc (1- b) a b n)
                        (calc n a b n))))


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

if b < n:
  x = b-1
elif b == n:
  x = b-1
else:
  x = n

print(int(a*x/b) - a*int(x/b))
Buggy python submission (verdict: Runtime Error):
import sympy

n, m = map(int, input().split())

if n % m == 0:
  print(int(n/m))
  exit()
else:
  lst = sympy.divisors(m)[::-1]
  for i in lst:
    if i == 1:
      print(i)
      exit()
    if m - i*(n-1) > 0:
      if (m - i*(n-1)) % i == 0:
        print(i)
        exit()
    else:
      continue

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n, m = map(int, input().split())

if n % m == 0:
  print(int(n/m))
  exit()
else:
  lst = make_divisors(m)[::-1]
  for i in lst:
    if i == 1:
      print(i)
      exit()
    if m - i*(n-1) > 0:
      if (m - i*(n-1)) % i == 0:
        print(i)
        exit()
    else:
      continue
Buggy python submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()
print(s[0:3])
Buggy python submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f
print(f2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
k=n
keta=1
x=26
while k>x:
    k-=x
    keta+=1
    x*=26

book=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
l=[]
for i in reversed(range(keta)):
    s=(k//(26**i))+1
    k-=(s-1)*(26**i)
    if i>0:
        l.append(book[s-1])
    else:
        l.append(book[s-2])
print("".join(l))


Fixed submission:
n=int(input())
k=n
keta=1
x=26
while k>x:
    k-=x
    keta+=1
    x*=26

book=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
l=[]

for i in reversed(range(1,keta)):
    s=(k-1)//(26**i)
    k-=s*(26**i)
    l.append(book[s])

l.append(book[k-1])
print("".join(l))
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))
for i in range(n):
    if x[i]==0:
        print(i+1)
        break

Fixed submission:
x=list(map(int,input().split()))
for i in range(len(x)):
    if x[i]==0:
        print(i+1)
        break
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
a = int( x**(1/5) )
b = int( x**(1/5) )
p = a**5-x
q = b**5-x
while abs(p**(1/5)).is_integer()!=True and abs(q**(1/5)).is_integer()!=True:
        a-=1
        b+=1
else:
    if abs(p**(1/5)).is_integer()==True:
        if p>=0:
            print(a,int(p**(1/5)))
        else:
            print(a,int(abs(p**(1/5)))*(-1))
    else:
        if q>=0:
            print(b,int(q**(1/5)))
        else:
            print(b,int(abs(q**(1/5)))*(-1))

Fixed submission:
x=int(input())
for i in range(10**3):
    for j in range(2*10**3):
        if (i)**5-(j-10**3)**5==x:
            print(i,j-10**3)
            exit()

Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
a = int( x**(1/5) )
b = int( x**(1/5) )
p = a**5-x
q = b**5-x
while abs(p**(1/5)).is_integer()!=True and abs(q**(1/5)).is_integer()!=True:
        a-=1
        b+=1
else:
    if abs(p**(1/5)).is_integer()==True:
        if p>=0:
            print(a,int(p**(1/5)))
        else:
            print(a,int(abs(p**(1/5)))*(-1))
    else:
        if q>=0:
            print(b,int(q**(1/5)))
        else:
            print(b,int(abs(q**(1/5)))*(-1))

Fixed submission:
x=int(input())
for i in range(10**3):
    for j in range(2*10**3):
        if (i)**5-(j-10**3)**5==x:
            print(i,j-10**3)
            exit()

Buggy python submission (verdict: Runtime Error):
a = int( x**(1/5) )
b = int( x**(1/5) )
p = a**5-x
q = b**5-x
while abs(p**(1/5)).is_integer()!=True and abs(q**(1/5)).is_integer()!=True:
        a-=1
        b+=1
else:
    if abs(p**(1/5)).is_integer()==True:
        if p>=0:
            print(a,int(p**(1/5)))
        else:
            print(a,int(abs(p**(1/5)))*(-1))
    else:
        if q>=0:
            print(b,int(q**(1/5)))
        else:
            print(b,int(abs(q**(1/5)))*(-1))

Fixed submission:
x=int(input())
for i in range(10**3):
    for j in range(2*10**3):
        if (i)**5-(j-10**3)**5==x:
            print(i,j-10**3)
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
  print(a.count(i))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=[0]*n
for i in range(n-1):
  x[a[i]-1]+=1
for j in range(n):
  print(x[j])
Buggy python submission (verdict: Runtime Error):
n=int(input())
def t(n):
    if n < 1:
        return 0
    return n + t(n - 1)
print(t(n)-3*t(n//3)-5*t(n//5)+15*t(n//15))

Fixed submission:
n=int(input())
def t(k):
  return k*(k+1)//2
print(t(n)-3*(t(n//3))-5*(t(n//5))+15*(t(n//15)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

x=0
k=int(input())
r = range(1, k + 1)
x = sum([gcd(a, b, c) for a in r for b in r for c in r])
print(x)

Fixed submission:
from math import gcd

k = int(input())

r = range(1, k + 1)
ans = sum([gcd(gcd(a, b), c) for a in r for b in r for c in r])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

x=0
k=int(input())

for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1,k+1):
      x+=gcd(i,j,l)

print(x)

Fixed submission:
from math import gcd

k = int(input())

r = range(1, k + 1)
ans = sum([gcd(gcd(a, b), c) for a in r for b in r for c in r])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = list(map(int,input().split()))
c = sorted(a)
l=[1]
m=0
for i in range(n-1):
  if c[i]==c[i+1]:
    l[m]+=1 
  else:
    l.append(1)
    m+=1
x=0
p=int(len(l))
for i in range(p):
  if l[i]>=2:
    x+=l[i]*(l[i]-1)//2
for i in range(n):
  q = a.count(a[i])
  if q>=2:
    print(x-q+1)
  else:
    print(x)

Fixed submission:
from collections import Counter

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

c=Counter(a)
ans=0
for i in c.keys():
  ans+=(c[i]*(c[i]-1))//2

for i in a:
  print(ans-c[i]+1)
Buggy python submission (verdict: Runtime Error):
x=n//(a+b)
if (a+b)*x<=a:
  t=n-x*(a+b)
else:
  t=a
print(a*x+t)

Fixed submission:
n,a,b=map(int,input().split())
x=n//(a+b)
if n-(a+b)*x<=a:
  t=n-x*(a+b)
else:
  t=a
print(a*x+t)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
s=input()
q=int(input())
t=[input() for i in range(q)]
l=deque(list(s))
for i in range(q):
  if int(t[i][0])==1:
    l.reverse()
  else:
    if int(t[i][2])==1:
      l.appendleft(t[i][4]) 
    else:
      l.append(t[i][4])
print(''.join(l))

Fixed submission:
from collections import deque
s=input()
q=int(input())
t=[input() for i in range(q)]
l=deque(list(s))
m=0
for i in range(q):
  if int(t[i][0])==1:
    m+=1
  else:
    if m%2==0:
      if int(t[i][2])==1:
        l.appendleft(t[i][4]) 
      else:
        l.append(t[i][4])
    else:
      if int(t[i][2])==2:
        l.appendleft(t[i][4]) 
      else:
        l.append(t[i][4])
if m%2==1:
  l.reverse()
print(''.join(l))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
s=input()
q=int(input())
t=[input() for i in range(q)]

l=deque()

for i in range(int(len(s))):
  l.append(s[i])

for i in range(q):

  if int(t[i][0])==1:
    l.reverse()

  else:   
    if int(t[i][2])==1:
      l.appendleft(t[i][4]) 
    
    else:
      l.append(t[i][4])

print(''.join(l))

Fixed submission:
from collections import deque
s=input()
q=int(input())
t=[input() for i in range(q)]
l=deque(list(s))
m=0
for i in range(q):
  if int(t[i][0])==1:
    m+=1
  else:
    if m%2==0:
      if int(t[i][2])==1:
        l.appendleft(t[i][4]) 
      else:
        l.append(t[i][4])
    else:
      if int(t[i][2])==2:
        l.appendleft(t[i][4]) 
      else:
        l.append(t[i][4])
if m%2==1:
  l.reverse()
print(''.join(l))
Buggy python submission (verdict: Runtime Error):
n=input()
print(round(n/2))

Fixed submission:
n=int(input())
if n%2==0:
  print(n//2)
else:
  print(n//2+1)
Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,n):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

Fixed submission:
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
print(l[0][0])
for i in range(1,n):
  if l[i-1][1]==l[i][1]:
    print(l[i][0])
  else:
    break

Fixed submission:
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
print(l[0][0])
for i in range(1,n):
  if l[i-1][1]==l[i][1]:
    print(l[i][0])
  else:
    break

Fixed submission:
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
print(c.most_common()[0][0])
for i in range(1,n):
  if c.most_common()[i-1][1]==c.most_common()[i][1]:
    print(c.most_common()[i][0])
  else:
    break

Fixed submission:
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))
s.sort()
a = [0]
for i in range(n-1):
  if s[i] != s[i+1]:
    a.append(i+1)
l = int(len(a))
t = 0
b = []
for u in range(l):
  p = s.count(s[a[u]])
  if t<p:
    t=p
    b.clear()
    b.append(a[u])
  elif t==p:
    b.append(a[u])
k = int(len(b))    
for r in range(k):
    print(s[b[r]])

Fixed submission:
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
for i in range(n):
  s[i]=x
print(s)

Fixed submission:
s=input()
n=int(len(s))
print("x"*n)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    x+=1
if x=0:
  print("YES")
else:
  print("NO")


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    x+=1
if x==0:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]=a[i+1]:
    x+=1
if x=0:
  print("YES")
else:
  print("NO")

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=0
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    x+=1
if x==0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
h,a=map(input(int()))
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

Fixed submission:
h,a=map(int,input().split())
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

Buggy python submission (verdict: Runtime Error):
h,a=map(int(input()))
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

Fixed submission:
h,a=map(int,input().split())
if h%a==0:
  print(h//a)
else:
  print(h//a+1)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
if k<=n:
  for i in range(k):
    a[i]=0
  print(sum(h))
else:
  print(0)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
if k<=n:
  for i in range(k):
    h[i]=0
  print(sum(h))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
import.math
h=int(input())
i=int(math.log(2,h))
print(2**(i+1)-1)

Fixed submission:
import math
h=int(input())
i=int(math.log(h,2))
print((2**(i+1))-1)
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()))
x=0
for i in range(n):
  if min(p[0:i+1])==p[i]:
    x+=1
print(x)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
x=0
s=p[0]
for i in range(n):
  if p[i]<=s:
    s=p[i]
    x+=1
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))
x=0
for s in range(n):
  for t in range(s+1):
    if p[s]>p[s-t]:
      x+=1
      break
print(n-x)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
x=0
s=p[0]
for i in range(n):
  if p[i]<=s:
    s=p[i]
    x+=1
print(x)
Buggy python submission (verdict: Runtime Error):
c=input()
print (chr(ord(c) + 1)


Fixed submission:
c=input()
a=[chr(i) for i in range(97, 97+26)]
print(a[a.index(c)+1])

Buggy python submission (verdict: Runtime Error):
c=input()
print chr(ord(c) + 1)

Fixed submission:
c=input()
a=[chr(i) for i in range(97, 97+26)]
print(a[a.index(c)+1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]="A" and s[i+1]="B" and s[i+2]="C":
    cnt += 1
print(cnt)

Fixed submission:
n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    cnt += 1
print(cnt)