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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
attack = 0
mon = a[0]
for i in range(n):
    if mon >= b[i]:
        sum += b[i]
        mon = a[i+1]
    else:
        sum += mon
        attack = b[i] - mon
        mon = max(0, a[i+1] - attack)
        sum += (a[i+1] - mon)
print(sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
b.append(0)
i=0
count=0
while True:
    if i==n+1:
        break
    elif a[i]>b[i]:
        i+=1
        count+=min(a[i],b[i])
    else:
        count+=min(a[i],b[i])
        c=b[i]-a[i]
        count+=min(a[i+1],c)
        if c>a[i+1]:
            a[i+1]=0
            i+=1
        else:
            a[i+1]-=c
            i+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
count=0
while True:
    count+=min(a[i],b[i])
    if i==n:
        break
    elif a[i]>b[i]:
        i+=1
    else:
        c=b[i]-a[i]
        count+=min(a[i+1],c)
        if c>a:
            a[i+1]=0
            i+=1
        else:
            a[i+1]-=c
            i+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
count=0
while True:
    count+=min(a[i],b[i])
    if i==n:
        break
    elif a[i]>b[i]:
        i+=1
    else:
        c=b[i]-a[i]
        count+=min(a[i+1],c)
        if c>a:
            a[i+1]=0
            i+=1
        else:
            a[i+1]-=c
            i+=1
print(count)
Problem p02987 (python)

Fixed submission:
s = str(input())
letter_list = []
for letter in s:
    letter_list.append(letter)
letter_list.sort()
l1 = letter_list[0]
l2 = letter_list[2]
if letter_list.count(l1) == 2 and letter_list.count(l2) == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n, k =map(int, input().split())
mod = 10 ** 9 + 7
def com(a, b):
  b = min(b, a-b)
  sum = 1
  for i in range(a-b+1, a+1):
    sum *= i
  for j in range(1, b+1):
    sum //= j
  return sum % mod
for i in range(1, k+1):
  ans = com(n-k+1, i) * com(k-1, i-1) % mod
  print(ans)
Problem p02571 (python)

Fixed submission:
s=input()
t=input()
import sys
a=0
b=[]
c=[]
if len(s)==len(t):
    for i in range(len(s)):
        if s[i]!=t[i]:
            a+=1
    print(a)
    sys.exit()
for i in range(len(s)-len(t)):
    b.append(s[i:len(t)+i])


for i in range(len(b)):
    for j in range(len(b[i])):
        if b[i][j]!=t[j]:
            a+=1
    c.append(a)
    a=0
        
print(min(c))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
a=0
b=[]
c=[]
for i in range(len(s)-len(t)):
    b.append(s[i:len(t)+i])


for i in range(len(b)):
    for j in range(len(b[i])):
        if b[i][j]!=t[j]:
            a+=1
    c.append(a)
    a=0
        
print(min(c))
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
z=n//(a+b)
x=n-z*(a+b)
if x>=a:
    c=a
else:
    c=x
print(a*z+c)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
z=n//(a+b)
x=n//z+(n%z)-(a+b)
print(a*z+x)
Problem p02771 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b and a!=c:
  print('Yes')
elif b==c and c!=a:
  print('Yes')
elif c==a and a!=b:
  print('Yes')
else:
  print('No')

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

if a!=b or a!=c or b!=c a+b==a*2 or a+c==a*2 or b+c==b*2:
  print('Yes')
else:
  print('No')
Problem p02777 (python)

Fixed submission:
a,b=input().split()
c,d=map(int,input().split())
e=input()
if e==a:
  c-=1
else:
  d-=1
print(c,d)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c,d=map(int,input().split())
e=int(input())
if e==a:
  c-=1
else:
  d-=1
print(c,d)
Problem p02779 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
d=len(b)
c=len(set(b))
if c==d:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
import sys
a=int(input())
b=list(map(int,input().split()))
c=[]
for i in range(a):
  c+=str(b[i])
  for i in range(len(c)):
    if i==len(c)-1:
      break
    if int(c[i+1])==b[i]:
      print('YES')
      sys.exit()
print('NO')

Buggy submission (verdict: Runtime Error):
import sys
a=int(input())
b=list(map(int,input().split()))
c=[]
for i in range(a):
  c+=str(b[i])
  for i in range(len(c)):
    if int(c[i+1])==b[i]:
      print('YES')
      sys.exit()
print('NO')

Buggy submission (verdict: Runtime Error):
import sys
a=int(input())
b=list(map(int,input().split()))
c=[]
for i in range(a):
  c+=b[i]
  for i in range(len(c)):
    if b[i]==c[i]:
      print('NO')
      sys.exit()
print('YES')
Problem p02785 (python)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()

if N - K < 0:
  print(0)
else:
  print(sum(H[:N-K]))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=-1
if len(c)<=b:
    print(0)
else:
    c.sort()
    for i in range(-1,-b-1,-1):
        c.pop(i)
        d-=1
    print(sum(c))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=-1
if len(c)<=b:
    print(0)
else:
    c.sort()
    for i in range(b):
        c.pop(d)
        d-=1
    print(sum(c))

Buggy submission (verdict: Runtime Error):
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
for i in range(a+e+1):
  f+=c[i]

print(f)

Buggy submission (verdict: Runtime Error):
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>=0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
  
  f+=c[e]
  f+=c[e-1]

  print(f)

Buggy submission (verdict: Runtime Error):
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
c.sort()
e=-1
f=0
for i in range(a):
  d+=c[i]
  

for i in range(b):
  if b>=0:
    b-=1
    f+=1
      
    d-=c[e]
    e-=1
    if d<=0:
      print(f)
      sys.exit()

  
f+=c[e]
f+=c[e-1]

print(f-1)

Buggy submission (verdict: Runtime Error):
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
c.sort()
e=-1
f=0
for i in range(a):
  d+=c[i]

for i in range(b):
   if b>0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
    if d<0:
      print(f)
      sys.exit()
while 1:
  d-=c[e]
  f+=1
  if d<0:
    print(f)
  else:
    pass
Problem p02831 (python)

Fixed submission:
A, B = map(int, input().split())
AA = A
BB = B
lcm = 1
cont = 1

while cont == 1:
  if A % B == 0 or B % A == 0:
    lcm = min(A, B)
    break
  
  if A < B:
    B = B % A
  elif A > B:
    A = A % B

ans = int(AA * BB / lcm)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import math
def x (a,b):
    return(a*b)//math.gcd(a,b)
print(x(a,b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import math
def x (a,b):
    return(a*b)//math.gcd(a,b)
print(x(a,b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
import math
def x (a,b):
    return(a*b)//math.gcd(a,b)
print(x(a,b))
Problem p02835 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a,b.c=map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')
Problem p02836 (python)

Fixed submission:
a=input()
b=a
c=b[::-1]
d=0
for i in range(len(a)//2):
  if a[i]!=c[i]:
    d+=1
  else:
    pass
print(d)

Buggy submission (verdict: Runtime Error):
a=input()
b=a
c=b.reverse()
d=0
for i in range(a):
  if a[i]!=b[i]:
    d+=1
  else:
    pass
print(d)
Problem p02847 (python)

Fixed submission:
c=0
a=input()
if a=='SUN':
  c+=7
elif a=='MON':
  c+=6
elif a=='TUE':
  c+=5
elif a=='WED':
  c+=4
elif a=='THU':
  c+=3
elif a=='FRI':
  c+=2
else:
  c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)
end

Buggy submission (verdict: Runtime Error):
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)
else:
  pass

Buggy submission (verdict: Runtime Error):
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)

Buggy submission (verdict: Runtime Error):
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)
else:
  pass
Problem p02880 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
for a in range(0,10):
  if N%a==0 and N/a<=9:
    print("Yes")
    break
  else:
    if a>=10:
      print("No")
Problem p02897 (python)

Fixed submission:
N=int(input())
if N%2==0:
  a=N/2
  b=a/N
  print(b)
else:
  t=N+1
  c=t/2
  d=c/N
  print(d)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2=1:
  a=N+1/2
  print(a)
else:
  b=N/2
  print(b)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2=1:
  a=N+1/2
  print(a)
else:
  b=N/2
  print(b)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2=1:
  a=(N+1)/2
  print(a)
else:
  b=N/2
  print(b)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2=1:
  a=(N+1)/2
  print(a)
else:
  b=N/2
  print(N)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2=1:
  a=N+1/2
  print(a)
else:
  b=N/2
  print(N)
Problem p02916 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0
ab=0
for i in range(N):
  d+=b[a[i]-1]
  
  if i != 0:
    if ab+1==a[i]:
      d+=c[ab-1]
   
  ab=a[i]
    
print(d)

Buggy 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()))
d=0

for i in range(N):
  d+=b[a[i]+1]
  if i-1==e:
    d+=c[e]
  e=i
print(d)
Problem p03012 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=10**4
for i in range(n):
  b=a[:i+1]
  c=a[i+1:]
  
  if abs(sum(b)-sum(c))<m:
    m=abs(sum(b)-sum(c))
    
print(m)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[0]*a
b=map(int,input().split())
c=0
m=0
for i in range(a):
  m+=b[i]
m/=a
n=int(m)

if (m-n)>=0.5:
  m=int(m)+1
else:
  m=int(m)
m*=a
for j n range(a):
  c+=b[j]
  if c>=m:
    for z in range(j+1,a):
      d+=b[z]
print(int(c-d))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
a=list(map(int,input().split()))
b=0
d=0
e=0
for i in range(N):
  b+=a[i]
c=b
b=b//N


if (c-b)*10>5:
  b+=1
for i in range(N):
  if a[i]>b:
    d+=b
  else:
    e+=b
print(math.sqrt(d-e))
Problem p03036 (python)

Fixed submission:
a,b,c=map(int,input().split())
for i in range(10):
  print(a*c-b)
  c=(a*c-b)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
for in range(10):
  print(a*c-b)
  b=(a*c-b)
Problem p03075 (python)

Fixed submission:
a=[0]*5
for i in range(5):
  a[i]=int(input())
b=int(input())
if a[4]-a[0]>b:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
a=[0]*5
for i in range(5):
  a[i]=int(input())
b=int(input())
if a[5]-a[0]>b:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
a=[0]*5
for i in range(5):
  a[i]=int(input())
b=int(input())
if a[5]-a[0]>a[6]:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
a=[0]*5
for i in range(5):
  a[i]=int(input())
b=int(input())
if a[4]-a[0]>a[5]:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
a=[0]*5
for i in range(5):
  a=int(input())
b=int(input())
if a[4]-a[0]>a[5]:
  print(':(')
else:
  print('Yay!')
Problem p02622 (python)

Fixed submission:
S = list(input())
T = list(input())
cnt = 0
for t in range(0,int(len(S))):
  if S[t] != T[t]:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
cnt = 0
for t in range(0,int(len(S))-1):
  if S[t] != T[t]:
    cnt++
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
cnt = 0
for t in range(int(len(S))):
  if S[t] != T[t]:
    cnt++
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
cnt = 0
for s,t in S,T:
  if s != t:
    cnt++
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input().split(''))
T = list(input().split(''))
cnt = 0
for s,t in S,T:
  if s != t:
    cnt++
print(cnt)
Problem p02699 (python)

Fixed submission:
#入力例全てOKだけど黄色#
S,W = map(int,input().split())

if S <= W :
    print("unsafe")

else :
    print("safe")

Buggy submission (verdict: Runtime Error):
S,W = map(int,input,split)

if S <= W :
    print("unsafe")

else :
    print("safe")

Buggy submission (verdict: Runtime Error):
S,W = amp(int,input,split)

if S <= W :
    print("unsafe")

else :
    print("safe")

Buggy submission (verdict: Runtime Error):
S = input()
W = input()

S = int(S)
W = int(W)

if S <= W :
    print("unsafe")

else :
    print("safe")

Buggy submission (verdict: Runtime Error):
#入力例全てOKだけど黄色#
S = input()
W = input()

S = int(S)
W = int(W)

if S <= W :
    print("unsafe")

elif S > W :
    print("safe")

Buggy submission (verdict: Runtime Error):
S = input()
W = input()

S = int(S)
W = int(W)

if S <= W :
    print("unsafe")

elif S > W :
    print("safe")

Buggy submission (verdict: Runtime Error):
S = input()
W = input()

if S <= W :
    print("unsafe")

elif S > W :
    print("safe")
Problem p02577 (python)

Fixed submission:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = input()
for i in range(len(n)):
    count += int(n[i])
if count%9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(len(n)):
    count += int(n[i])
if count%9 == 0:
    print("Yes")
else:
    print("No")
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
quo = n // (a+b)
rem = n % (a+b)
ans = quo*a
if rem == 0:
    print(ans)
elif rem < a:
    print(ans + rem)
else:
    print(ans + a)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
str = ''
while len(str) < n:
    str += 'b'*a + 'r'*b
ans_str = str[0:n]
print(ans_str.count('b'))
Problem p02766 (python)

Fixed submission:
n, k = map(int, input().split())
def digits(N, K):
    if (int(N/K)):
        return digits(int(N/K), K) + str(N%K)
    return str(N%K)
print(len(digits(n, k)))

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
x = str(x)
print(int(x, y))
Problem p02785 (python)

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
nums = list(map(int, input().split()))
if n <= k:
    print(0)
else:
    for i in range(k):
        nums.pop(max(nums))
    print(sum(nums))
Problem p02831 (python)

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a,b):
    return a*b//gcd(a,b)

a, b = map(int, input().split())
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
ans = (a*b)/math.gcd(a, b)
print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print((a*b)//math.gcd(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print((a*b)//math.gcd(a, b))
Problem p02879 (python)

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

if a >= 10:
    print(-1)
elif b >= 10:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
N = input().rsplit().split('')
N1 = N[0]
N2 = N[1]

if N1 >=10 or N2 >= 10:
  print(-1)
  
else:
  print(N1 * N2)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())

if n%2==0:
    print(n/2/n)
else:
    print(((n/2)+1)/n
Problem p02987 (python)

Fixed submission:
s = input()
s_sort = ''.join(sorted(s))
s1 = s[0]
s1cnt = s_sort.count(s1)
if s1cnt == 2:
    s2 = s[2]
    s2cnt = s_sort.count(s2)
    if s2cnt == 2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
sCnt = s.count('S')
if sCnt != 2:
    print('No')
else:
    s = s.sort()
    if s[0]=='S':
        if s[2]==s[3]:
            print('Yes')
        else:
            print('No')
    elif  s[3]=='S':
        if s[0]==s[1]:
            print('Yes')
        else:
            print('No')
    else:
        if s[1]==s[2]:
            print('Yes')
        else:
            print('No')
Problem p03834 (python)

Fixed submission:
s = input().split(',')
print(s[0]+' '+s[1]+' '+s[2])

Buggy submission (verdict: Runtime Error):
s = input().split()
print(s[0]+' '+s[1]+' '+s[2])
Problem p02595 (python)

Fixed submission:
import sys
import math

count = 0
N, D = map(int, input().split())
for _ in range(N):
  x, y = map(int, input().split())
  dis = math.sqrt(x ** 2 + y ** 2)
  if dis <= D:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import math
X, D = map(int, input().split())
n = 0
for i in range(N):
  x, y = map(int, input().split())
  if math.sqrt(x**2+y**2) <= D:
    n += 1
print(n)
Problem p02596 (python)

Fixed submission:
K = int(input())
ans = '-1'
mod = 7%K
path = [mod]
for i in range(1,K+1):
  if mod == 0:
    ans = i
    break
  mod = (mod*10 + 7)%K
  path.append(mod)
  if mod == path[0]:
    ans = '-1'
    break
print(ans)

Buggy submission (verdict: Runtime Error):
K = int(input())
a = [0]
out = '-1'
for n in range(1, K):
  a.append((a[n-1] + 7 * (10 ** (n-1)))%K)
for i in range(1, K):
  if a[i] == 0:
    out = i
  	break
print(out)

Buggy submission (verdict: Runtime Error):
K = int(input())
a = 0
n = 0
out = -1
for _ in range(K):
  a += 7 * (10 ** n)
  if a % K == 0:
    out = n + 1
    break
return print(out)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
N = len(S)
ans = 0
for i in range(N):
    if S[i] != T[i]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
N = len(S)
ans = 0
for i in range(N):
    if not S[i] == T[i]:
        S[i] = T[i]
        ans += 1
print(ans)
Problem p02571 (python)

Fixed submission:
s = input()
t = input()
ans = 0
A = []
for i in range(len(s)-len(t)+1):
    s_i = s[i:i+len(t)+1]
    count = 0
    for j in range(len(t)):
        if s_i[j] == t[j]:
            count += 1
    A.append(count)

ans = len(t) - max(A)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
A = []
for i in range(len(s)-len(t)):
    s_i = s[i:i+len(t)+1]
    count = 0
    for j in range(len(t)):
        if s_i[j] == t[j]:
            count += 1
    A.append(count)
ans = len(t) - max(A)
print(ans)
Problem p02726 (python)

Fixed submission:
# = map(int, input().split())
# = list(map(int, input().split()))
n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = [0] * n
for i in range(n):
    for j in range(i+1, n):
        dist = min([j-i, abs(x-i)+abs(y-j)+1, abs(y-i)+abs(x-j)+1]) 
        ans[dist] += 1
for k in range(1, n):
    print(ans[k])

Buggy submission (verdict: Runtime Error):
# = map(int, input().split())
# = list(map(int, input().split()))
n, x, y = map(int, input().split())
x -= 1
y -= 1
ans = ()
for i in range(n):
    for j in range(i+1, n):
        a = min([j-i, abs(x-i)+abs(y-j)+1, abs(y-i)+abs(x-j)+1]) 
        ans.append(a)
ans = (str(l) for l in ans)

for k in range(1, n):
    finalans=ans.count(str(k))
    print(finalans)
Problem p02753 (python)

Fixed submission:
s = input()
if s == 'AAA' or s == 'BBB':
    ans = 'No'
else:
    ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
q_num = int(input())
head = []
tail = []
flip = 0
for i in range(q_num):
    q = tuple(input().split())
    if q[0] == '1':
        flip ^= 1
    else:
        f = int(q[1]) - 1
        c = q[2]
        if f ^ flip == 0:
            head.append(c)
        else:
            tail.append(c)
if flip:
    head, tail = tail, head
    s = s[::-1]
head = ''.join(head)
tail = ''.join(tail)
print(head[::-1] + s + tail)
Problem p02771 (python)

Fixed submission:
l =list(map(int, input().split()))
if len(l) == len(set(l)) + 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = [input() for i in range(N)]
c = Counter(S)
ans = c.most_common()
ans = [i[0] for i in ans if i[1] == ans[0][1]]
for i in sorted(ans):
    print(i)
Problem p02773 (python)

Fixed submission:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
c = Counter(S)
ans = c.most_common()
ans = [i[0] for i in ans if i[1] == ans[0][1]]
for i in sorted(ans):
    print(i)

Buggy submission (verdict: Runtime Error):
N = int(input())
S =[input() for _ in range(N)]
A = [S.count(S[i]) for i in range (N)]
Max_A = max(A)
ans = []
for i in A:
    if i == Max_A:
        ans.append(S[i])
ans = set(ans)
ans = list(ans)
ans.sort()
print("\n".join(ans))
Problem p02831 (python)

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

ans = (a * b) // fractions.gcd(a, b)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())

ans = (a * b) // math.gcd(a, b)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())

ans = (a * b) // math.gcd(a, b)
print(ans)