Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
N,D = map(int,input().split())
print(math.cell(N/(2*D)))


Fixed submission:
import math
N,D = map(int,input().split())
print(math.ceil(N/(2*D+1)))

Buggy python submission (verdict: Runtime Error):
import math
N,D = map(int,input().split())
print(math.floor(N/(2D)))


Fixed submission:
import math
N,D = map(int,input().split())
print(math.ceil(N/(2*D+1)))
Buggy python submission (verdict: Runtime Error):
N=int(input())
list=[]
for i in range(N):
  list.append(int(input()))
M=max(list)
L=[i for i, v in enumerate(list) if v == M]
n=len(L)
if n>1:
  for i in range(N):
    print(M)
elif:
  del list[L[0]]
  M2=max(list)
  for i in range(N):
    if i == L[0]:
      print(M2)
    elif:
      print(M)

Fixed submission:
N=int(input())
list=[]
for i in range(N):
  list.append(int(input()))
M=max(list)
L=[i for i, v in enumerate(list) if v == M]
n=len(L)
if n>1:
  for i in range(N):
    print(M)
else:
  del list[L[0]]
  M2=max(list)
  for i in range(N):
    if i == L[0]:
      print(M2)
    else:
      print(M)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print('-1')
  sys.exit()
s = 7
c = 1
while True:
  if s % k == 0:
    break
  s = 10 * s + 7
  c += 1
print(c)

Fixed submission:
import sys
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print('-1')
  sys.exit()
s = 7
c = 1
while True:
  if s % k == 0:
    break
  s = (10 * s + 7) % k
  c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
c = input()
s = Counter(c)
if s['W'] == 0:
  print('0')
elif c.index('R') == 0 and c.index('W') == s['R']:
  print('0')
elif s['R'] > c.index('R'):
  print(s['R'] - (c.index('R')+1) + c.index('R'))
else:
  print(s['R'])

Fixed submission:
import sys
from collections import Counter
n = int(input())
c = list(input())
s = Counter(c)
if s['R'] == 0 or s['W'] == 0:
  print('0')
  sys.exit()
pos_w=0
pos_r=n-1
count = 0
for i in range(pos_w, n):
  if c[i] != 'W':
    continue
  pos_w = i
  for j in range(pos_r, -1, -1):
    if c[j] != 'R':
      continue
    pos_r = j
    if pos_w > pos_r:
      print(count)
      sys.exit()
    c[i] = 'R'
    c[j] = 'W'
    count += 1
    break
Buggy python submission (verdict: Runtime Error):
import sys
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
digit=1
check=26
while num > check:
  digit+=1
  check+=26**digit
digit-=1
if digit == 0:
  print(alpha[num-1])
  sys.exit()
ans=[]
while digit > 1:
  if num % 26**digit == 0:
    ans.append(alpha[num//(26**digit)-2])
  else:
  	ans.append(alpha[num//(26**digit)-1])
  num%=26**digit
  digit-=1
if num % 26 == 0:
  ans.append(alpha[num//26-2])
else:
  ans.append(alpha[num//26-1])
ans.append(alpha[num%26-1])
print(''.join(ans))

Fixed submission:
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
ans=[]
while num > 0:
  ans.append(alpha[num%26-1])
  num//=26
  if ans[-1]=='z':
    num-=1
print(''.join(ans[::-1]))

Buggy python submission (verdict: Runtime Error):
import sys
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
digit=1
check=26
while num > check:
  digit+=1
  check+=26**digit
digit-=1
if digit == 0:
  print(alpha[num-1])
  sys.exit()
ans=[]
while digit > 1:
  ans.append(alpha[num//(26**digit)-1])
  num%=26**digit
  digit-=1
ans.append(alpha[num//26-1])
ans.append(alpha[num%26-1])
print(''.join(ans))

Fixed submission:
alpha=[s for s in 'abcdefghijklmnopqrstuvwxyz']
num=int(input())
ans=[]
while num > 0:
  ans.append(alpha[num%26-1])
  num//=26
  if ans[-1]=='z':
    num-=1
print(''.join(ans[::-1]))
Buggy python submission (verdict: Runtime Error):
def sumdic(dic):
  s=0
  for k, v in dic.items():
    s+=int(k)*v
  return s

a=int(input())
dic={}
for x in input().split():
  if x in dic:
    dic[x]+=1
  else:
    dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
  (b,c)=[x for x in input().split()]
  if c in dic:
    dic[c]+=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  elif b in dic:
    dic[c]=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  print(s)

Fixed submission:
def sumdic(dic):
  s=0
  for k, v in dic.items():
    s+=int(k)*v
  return s

a=int(input())
dic={}
for x in input().split():
  if x in dic:
    dic[x]+=1
  else:
    dic[x]=1
s=sumdic(dic)
d=int(input())
for i in range(d):
  (b,c)=[x for x in input().split()]
  if c in dic and b in dic:
    dic[c]+=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  elif b in dic:
    dic[c]=dic[b]
    s+=(int(c)-int(b))*dic[b]
    dic.pop(b)
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt
from collections import Counter

def is_prime(n):
  if n == 1:
    return False
  for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
      return False
  return True

def make_divisors(n, d):
    lower_divisors , upper_divisors = [], []
    i = 2
    while i*i <= n:
        if n % i == 0:
            if d[i] > 0:
              return True
            if i != n // i and d[n//i] > 0:
                return True
        i += 1
    return False

a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
c=0
if d[1] > 1:
  print(0)
elif d[1] > 0:
  print(1)
else:
  for i in range(0, a):
    if d[b[i]] > 1:
      c+=1
    elif not is_prime(b[i]):
      if make_divisors(b[i], d):
        c+=1
  print(a-c)

Fixed submission:
from collections import Counter

def board(dp, i):
  m = 1
  while i*m <= len(dp)-1:
    dp[i*m]=False
    m+=1

a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
dp=[True]*(b[-1]+1)
c=0
for i in b:
  if dp[i] and d[i] < 2:
    c+=1
  board(dp, i)
print(c)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
c=0
if b[0] == b[1]:
  c+=1
for i in range(0, a):
  for j in range(0, i):
    if b[i] % b[j] == 0:
      c+=1
      break
print(a-c)

Fixed submission:
from collections import Counter

def board(dp, i):
  m = 1
  while i*m <= len(dp)-1:
    dp[i*m]=False
    m+=1

a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
dp=[True]*(b[-1]+1)
c=0
for i in b:
  if dp[i] and d[i] < 2:
    c+=1
  board(dp, i)
print(c)
Buggy python submission (verdict: Runtime Error):
(a,b)=[int(x) for x input().split()]
print(a*b)

Fixed submission:
(a,b)=[int(x) for x in input().split()]
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(x) for x in input().split()]
m=1
for i in a:
  m*=i
print(m if m <= 10**18 else -1)

Fixed submission:
import sys
n=int(input())
a=[int(x) for x in input().split()]
a=sorted(a, reverse=True)
m=1
if a[-1] == 0:
  print(0)
else:
  for i in a:
    m*=i
    if m > 10**18:
      print('-1')
      sys.exit()
  print(m)
Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt

def is_prime(n):
  if n == 1:
    return False
  for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
      return False
  return True

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(sqrt(n))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
        if len(arr) > 1:
          break

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

base=int(input())
tmp=base
num=[]
if is_prime(base):
  num.append(base)
else:
  for i in range(2, base+1):
    if i > tmp:
      break
    if tmp % i == 0 and len(factorization(i)) == 1:
      num.append(i)
      tmp/=i
print(len(num))

Fixed submission:
from math import sqrt

def is_prime(n):
  if n == 1:
    return False
  for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
      return False
  return True

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(sqrt(n))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
        if len(arr) > 1:
          break

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

base=int(input())
tmp=base
num=[]
if is_prime(base):
  num.append(base)
else:
  for i in range(2, base+1):
    if i > tmp:
      break
    if tmp % i == 0 and len(factorization(i)) == 1:
      num.append(i)
      tmp/=i
      if is_prime(tmp):
        num.append(tmp)
        break
print(len(list(set(num))))
Buggy python submission (verdict: Runtime Error):
if gets()=="ABC"
  puts "ARC"
else
  puts "ABC"
end

Fixed submission:
s=input()
print('ARC' if s=='ABC' else 'ABC')
Buggy python submission (verdict: Runtime Error):
x=int(input())
for i in range(-118, 120):
  if x-pow(i, 5)>=0:
    if pow((x-pow(i, 5)), 0.2).is_integer():
      b=pow((x-pow(i, 5)), 0.2)
      print(a, b)
      break
  else:
    if pow(-(x-pow(i, 5)), 0.2).is_integre():
      b=pow(-(x-pow(i, 5)), 0.2)
      print(a, b)
      break

Fixed submission:
import sys
x=int(input())
for i in range(-118, 120):
  for j in range(-119, 118):
    if pow(i, 5)-pow(j, 5)==x:
      print(i, j)
      sys.exit()
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1,10):
  for j in range(i, 10):
    if i*j==n:
      print('Yes')
      return
print('No')

Fixed submission:
n = int(input())
for i in range(1,10):
  for j in range(i, 10):
    if i*j==n:
      print('Yes')
      exit()
print('No')
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
i = 0
while(i<len(s)-1):
  if s[i] == s[i+1]:
    s.pop(i)
  else:
    i+=1
print(len(s))

Fixed submission:
a = int(input())
s = list(input())
i = 0
while(i<len(s)-1):
  if s[i] == s[i+1]:
    s.pop(i)
  else:
    i+=1
print(len(s))
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = (int(x) for x in input().split())
players = [k] * n
for i in range(q):
  player = int(input())
  players = [players[j]-1 if j != player-1 else players[j] for j in range(n)]
answer = ['Yes' if player > 0 else 'No' for player in players]
for i in range(n):
  print(answer[i])

Fixed submission:
n,k,q = (int(x) for x in input().split())
players = [k] * n
result = [0] * n
for i in range(q):
  player = int(input())
  result[player-1] = result[player-1] + 1
for i in range(n):
  if players[i] - q + result[i] > 0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
answer = 0
for i in range(n):
  strn = input()
  strn = ''.join(sorted(strn))
  answer += strings.count(strn)
  strings.append(strn)
print(answer)

Fixed submission:
n = int(input())
strings = {}
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings[string]=1
  else:
    answer += strings[string]
    strings[string] += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  answer += strings.count(string)
  strings.append(string)
print(answer)

Fixed submission:
n = int(input())
strings = {}
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings[string]=1
  else:
    answer += strings[string]
    strings[string] += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
num = []
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings.append(string)
    num.append(0)
  else:
    hoge = num[strings.index(string)] = num[strings.index(string)] + 1
    answer = answer + hoge
print(answer)

Fixed submission:
n = int(input())
strings = {}
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings[string]=1
  else:
    answer += strings[string]
    strings[string] += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
num = []
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings.append(string)
    num.append(0)
  else:
    num[strings.index(string)] += 1
    answer = answer + num[strings.index(string)]
print(answer)

Fixed submission:
n = int(input())
strings = {}
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings[string]=1
  else:
    answer += strings[string]
    strings[string] += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strings = []
answer = 0
for i in range(n):
  string = input()
  string = sorted(string)
  strchar=[string['char'] for string in strings]
  if string not in strchar:
    strings.append(dict(char=string, num=0))
  else:
    strchar=[strn for strn in strings if string == strn['char']]
    strchar[0]['num'] = strchar[0]['num'] + 1
    answer = answer + strchar[0]['num']
print(answer)

Fixed submission:
n = int(input())
strings = {}
answer = 0
for i in range(n):
  string = input()
  string = ''.join(sorted(string))
  if string not in strings:
    strings[string]=1
  else:
    answer += strings[string]
    strings[string] += 1
print(answer)
Buggy python submission (verdict: Runtime Error):
a,b,c = [int(x) for x in inpput().split()]
print(b+c-a if b+c-a > 0 else 0)

Fixed submission:
a,b,c = [int(x) for x in input().split()]
print(b+c-a if b+c-a > 0 else 0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(i)%2==1:
    ans += 1
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
  if len(str(i))%2==1:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,d=[int(x) for x in input().split()]
x=[list(map(int,input().split())) for i in range(n)]
answer = 0
for i in range(n):
  for j in range(i+1,n):
    v = (x[i][0]-x[j][0])**2+(x[i][1]-x[j][1])**2
    k = 1
    while k**2<=v:
      if k**2 == v:
        answer += 1
        break
      k += 1
print(answer)

Fixed submission:
n,d=[int(x) for x in input().split()]
x=[list(map(int,input().split())) for i in range(n)]
answer = 0
for i in range(n):
  for j in range(i+1,n):
    v = 0
    for k in range(d):
    	v += (x[i][k]-x[j][k])**2
    	t = 1
    while t**2<=v:
      	if t**2 == v:
        	answer += 1
        	break
      	t += 1
print(answer)
Buggy python submission (verdict: Runtime Error):
(a,b)=list(map(int, input().split()))
print(''.join([c if i!=b-1 else c.lower() for i,c in enumerate(s:=input())]))

Fixed submission:
(a,b)=list(map(int, input().split()))
s=input()
print(''.join([c if i!=b-1 else c.lower() for i,c in enumerate(s)]))
Buggy python submission (verdict: Runtime Error):
x, k, d = map(int, input().split(" "))

def y(l): return abs(x + l * d - (k - l) * d)

lf = max(0, (k - x / d) / 2)
l = int(lf)
if lf - l > 0 and l + 1 <= k:
    print(min(y(l), y(l + 1)))
else:
    print(y(l))


Fixed submission:
print({
    "SSS": 0,
    "SSR": 1,
    "SRS": 1,
    "SRR": 2,
    "RSS": 1,
    "RSR": 1,
    "RRS": 2,
    "RRR": 3,
}[input()])
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
number = 0

for i in range(N):
    X,Y = map(int, input().split())
    distance = sqrt(X*X+Y*Y)
    if distance <= D:
        number += 1


Fixed submission:
import numpy

N, D = map(int, input().split())
number = 0

for i in range(N):
    X,Y = map(int, input().split())
    distance = numpy.sqrt(X*X+Y*Y)
    if distance <= D:
        number += 1
print(number)

Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().strip().split())
number = 0

for i in range(N):
    X,Y = map(int, input().split())
    distance = sqrt(X*X+Y*Y)
    if distance <= D:
        number += 1

Fixed submission:
import numpy

N, D = map(int, input().split())
number = 0

for i in range(N):
    X,Y = map(int, input().split())
    distance = numpy.sqrt(X*X+Y*Y)
    if distance <= D:
        number += 1
print(number)
Buggy python submission (verdict: Runtime Error):
import math
import time
import sys

sys.setrecursionlimit(5000)
def judge_debisible(K, seven_number):
    gcd_number = math.gcd(K,seven_number)
    elapsed_time = time.time() - start_time
    print(elapsed_time)
    if elapsed_time > 0.1:
        print("-1")
    elif gcd_number == 1 :
        judge_debisible(K, seven_number*10+7)
    else:
        print(len(str(seven_number)))

K = int(input())
start_time = time.time()
judge_debisible(K, 7)

Fixed submission:
K = int(input())
seven_number = 0
ality = 0
for ans in range(1,10**7):
        if ans > K:
            print("-1")
            break
        else:
            seven_number = (seven_number*10+7) % K
            if seven_number ==0:
                print(ans)
                break
Buggy python submission (verdict: Runtime Error):
N=int(input())
b=[]
L=[]
b=input().split()
M=[]
for i in range(N):
    L.append(int(b[i]))
L.sort()
L.reverse()
#print(L)
x=0
y=0
p=0
index=0
for i in range(N-2):
    x=L.pop(0)
    for j in range(N-2-i):
        y=L.pop(0)
        for k in range(N-2-i-j):
#            print('i,j,k :'+str(i)+str(j)+str(k)+':'+str(x)+str(y)+str(L[k]))
            if x<y+L[k]:
                index+=1
            else:
                break
        M.append(y)
    L=M+L
    M.clear()
print(index)


Fixed submission:
A,B = map(int,input().split())
if A>=B*2:
    print(A-B*2)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())

t=0
for i in range(N-1):
    if S[i+1] == S[i]:
        t+=1
print(N-t)


Fixed submission:
A,B = map(int,input().split())
if A>=B*2:
    print(A-B*2)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
s=input()
S=list(s)


t=0
for i in range(N-1):
    if S[i-t+1] == S[i-t]:
        S.remove(S[i-t+1])
        t+=1
print(N-t)


Fixed submission:
N=int(input())
S=list(input())

t=0
for i in range(N-1):
    if S[i+1] == S[i]:
        t+=1
print(N-t)
Buggy python submission (verdict: Runtime Error):

s = input().split()
n=int(s[0])

s=(input().split())

list=[[0 for i in range(2)] for j in range(n)]


for i in range(n):
    list[i][1]=i
    list[i][0]=int(s[i])

list.sort()

#print('list = {}'.format(list))
answer=[]
for i in range(n):
    print(list[i][1]+1)
    #list.append(list[i][1]+1)

#print(answer)


Fixed submission:
N = int(input())
print(1 - (N//2)/N)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if (L[i] != L[j] and L[i] != L[k] and L[j] != L[k]) and (L[i] + L[j] > L[k] and L[i] + L[k] > L[j] and L[j] + L[k] > L[i]):
                cnt += 1
print(cnt)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
cnt = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = map(int, input().split())
cnt = 0
for i in range(N-2):
        # L[i]
    for j in range(i+1,N-1):
        # L[j]
        for k in range(j+1,N):
            print(i,j,k)
            if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
cnt = 0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if L[i] == L[j] or L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] + L[j] <= L[k] or L[i] + L[k] <= L[j] or L[j] + L[k] <= L[i]:
                continue
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b = input().split("")
if a == b:
  print("Yes")
else:
  print("No")

Fixed submission:
a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a, b = input().split("")
if a == b:
  print(yes)
else:
  print(no)

Fixed submission:
a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
l = [str(a) * int(b), str(b) * int(a)].sort()
print(l[0])

Fixed submission:
a, b = input().split()
l = [str(a) * int(b), str(b) * int(a)]
l.sort()
print(l[0])
Buggy python submission (verdict: Runtime Error):
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)

Fixed submission:
inp =input()
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)

Buggy python submission (verdict: Runtime Error):
def main():
  s = list(input())
  ans = 0
  ansli =list()
  for i in range(len(s)):
    if s[i] == "R":
      ans += 1
      ansli.append(ans)
    else:
      ans = 0
  print(max(ansli))
  
if __name__ == "__main__":
  main()

Fixed submission:
def main():
  s = list(input())
  ans = 0
  ansma = 0
  for i in s:
    if i == "R":
      ans += 1
    else:
      ans = 0
    if ans >= ansma:
      ansma = ans
  print(ansma)
  
if __name__ == "__main__":
  main()

Buggy python submission (verdict: Runtime Error):
def main():
  s = list(input())
  ans = 0
  ansli =list()
  for i in range(len(s)):
    if s[i] == "R":
      ans += 1
      ansli.append(ans)
    else:
      ans = 0
  print(max(ansli))
  
if __name__ == "__main__":
  main()

Fixed submission:
def main():
  s = list(input())
  ans = 0
  ansma = 0
  for i in s:
    if i == "R":
      ans += 1
    else:
      ans = 0
    if ans >= ansma:
      ansma = ans
  print(ansma)
  
if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
def main():
  N,K=map(int,input().split())
  for i in range(K):
    input()
    a |= set(list(map(int,input.split())))
  print(n-len(a))
  
 
if __name__ == "__main__":
  main()

Fixed submission:
def main():
  n, k = map(int, input().split())
  a = set()
  for i in range(k):
    input()
    a |= set(list(map(int, input().split())))
  print(n-len(a))

if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int,input().split()))
    listcost = []
  
    for i in range(min(a),max(a)):
        cost = 0
        for j in a:
            if i != j:
                cost += (i-j) ** 2
        listcost.append(cost)
    print(min(listcost))
  
  
if __name__=='__main__':
  main()

Fixed submission:
def main():
    n = int(input())
    a = list(map(int,input().split()))
    listcost = []
  
    for i in range(min(a),max(a)+1):
        cost = 0
        for j in a:
            if i != j:
                cost += (i - j) ** 2
        listcost.append(cost)
    print(min(listcost))
  
  
if __name__=='__main__':
  main()
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
print(T+S)

Fixed submission:
S, T = input().strip().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
import sys

N, K = [int(x) for x in stdin.readline().rstrip().split()]
h = np.array(map(int, [stdin.readline().rstrip() for _ in range(N)]))

hs = h.sort()
hmin = sys.maxint

for i in range(0, N-K):
    hdiff = hs[i+K] - hs[i]
    if hdiff < hmin:
        hmin = hdiff

print(hmin)



Fixed submission:
from sys import stdin
import numpy as np
import sys

N, K = [int(x) for x in stdin.readline().rstrip().split()]
h = np.array(list(map(int, [stdin.readline().rstrip() for _ in range(N)])))

h.sort()
hmin = 2**30

for i in range(0, N-K+1):
    hdiff = h[i+K-1] - h[i]
    if hdiff < hmin:
        hmin = hdiff

print(hmin)