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

Fixed submission:
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
    if R1 < L2 or R2 < L1:
        return(False)
    else:
        a = [R1,L1,R2,L2]
        a.sort()
        return(a[1],a[2])

for i in range(M - 1):
    L,R = map(int, input().split())
    if find_key(L1,R1,L,R) != False:
        L1,R1 = find_key(L1,R1,L,R)
    else:
        flag = 1
        print(0)
        break
if flag == 0:
    print(R1-L1+1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    return(False)
  else:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])

for i in range(M - 1):
  L,R = map(int, input().split())
  if find_key(L1,R1,L,R) != False:
    L1,R1 = find_key(L1,R1,L,R)
  else:
    flag = 1
    print(0)
    break
if flag = 0:
  print(R1-L1+1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
L1, R1 = map(int, input().split())
flag = 0
def find_key(L1,R1,L2,R2):
  if R1 < L2 or R2 < L1:
    print(0)
    flag = 1
    break
  elif:
    a = [R1,L1,R2,L2]
    a.sort()
    return(a[1],a[2])
for i in range(M - 1):
  L,R = map(int, input().split())
  L1,R1 = find_key(L1,R1,L,R)
if flag == 1:
  print(L1,R1)
Problem p02772 (python)

Fixed submission:
n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if (a==b or a==c) and (b!=c):
    print('Yes')
elif (b==a or b==c) and (a!=c):
    print('Yes')
elif (c==a or c==b) and (a!=b):
    print('Yes')
else:
    print('No')



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if (a==b or a==c) and (b!=c):
    print('Yes')
elif (b==a or b==c) and (a!=c):
    print('Yes')
elif (c==a or c==b) and (a!=b):
    print('Yes')
else:
    print('No')



n = int(input())
flag=0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i%2==0 and i%3!=0 and i%5!=0:
        flag=1 
    else:
        continue
if flag==1:
    print("DENIED")
else:
    print("APPROVED")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if (A == B or A == C) and (B != C):
    print('Yes')
elif (B == A or B == C) and (A != C):
    print('Yes')
elif (C == A or C == B) and (A != B):
    print('Yes')
else:
    print('No')

n = int(input())
flag = 0
lst = [int(i) for i in input().split()][:n]
for i in lst:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flag = 1
    else:
        continue
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")
Problem p02783 (python)

Fixed submission:
from math import ceil

H, A = map(int, input().split())
print(ceil(H/A))

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
move = [int(a) for a in map(int, input().split())]

smove = sum(move)
if smove >= H:
    print("Yes")
else:
    print("No")
Problem p03433 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())
if n-(int)(n/500)*500 <= a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())
if n-(int)(n/500)*500 <= a:
  print('Yes')
else
  print('No')
Problem p02854 (python)

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np
 
N=int(input())
A = np.array([int(x) for x in input().split()])
if N==2:
  print(abs(A[0]-A[1]))
else:
  B = np.concatenate([[0],A.cumsum()])
  H = np.searchsorted(B,sum(A)//2)
  result=float('inf')
  for i in range(min(5,len(A)//2)):
    result=min(result,abs(sum(A[:H+i])-sum(A[H+i:])),abs(sum(A[:H-i])-sum(A[H-i:])))

  print(result)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]
L=sum(A)
for i in range(N):#真ん中の棒を探す
  if sum(A[:i])>=L/2:
    p=i
    break
X=abs(sum(A[:p])-sum(A[p+1:]))#両サイドの差
Y=A[p]
result=abs(X-Y)
print(result)
Problem p02882 (python)

Fixed submission:
import math
a,b,x = map(int,input().split())
if a**2*b>x> (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif x<=a*a*b/2:
  tan=a*b*b/(2*x)
elif x==a*a*b:
  tan=0
  

print(math.degrees(math.atan(tan)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if a**2*b>x> (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif x<a*a*b/2:
  tan=a*b*b/(2*x)
elif x=a*a*b:
  tan=0
  

print(math.degrees(math.atan(tan)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if a**2*b>x>= (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif x<a*a*b/2:
  tan=a*b*b/(2*x)
  

print(math.degrees(math.atan(tan)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if a**2*b>x>= (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif a**2*b>x:
  tan=a*(b**2)/x
print(math.degrees(math.atan(tan)))
Problem p02885 (python)

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

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

p = ''
result = 0
for i in range(N):
    if p != S[i]:
        result += 1
        p = S[i]
print(result)
Problem p02886 (python)

Fixed submission:
N= int(input())
d = list(map(int,input().split()))

r = 0
for i in range(N-1):
    for j in range(i+1,N):
        r +=d[i]*d[j]
print(r)

Buggy submission (verdict: Runtime Error):
N=input()
List=list(map(int,input().split()))
i =0 
j =0
for i in range(N):
    for j in range(N):
        t = List[i]*List[j]
print(t)
Problem p02900 (python)

Fixed submission:
def gcd(a,b):#最大公約数
  return a if b == 0 else gcd(b,a%b)

def prime_factorize(n):#素因数分解
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
A,B = map(int,input().split())
X=gcd(A,B)
P=prime_factorize(X)

answer=len(set(P))+1
print(answer)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
L=[]#公約数のリスト
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0:
    L +=[i]
#公約数の中の素数を数える。素数でないものを取り除く
for j in range(len(L)):
  for k in range(2,L[j]):
    if L[j]%k==0:
      del L[j]
      break
print(len(L))
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
c = 0
for i in range(3):
	if S[i]==T[i]: c += 1
print(c)

Buggy submission (verdict: Runtime Error):
result = 0
for i in range(3):
  if T[i] == S[i]:
    result +=1
print(result)
Problem p03106 (python)

Fixed submission:
a,b,k =map(int,input().split())
p=[]
for i in range(max(a,b)+1):
  if i>0:
    if a%i == 0 and b%i == 0:
      p +=[i]
print(p[-k])

Buggy submission (verdict: Runtime Error):
a,b,k =map(int,input().split())
p=[]
for i in range(int((a+b)//4)):
  if i>0:
    if a%i == 0 and b%i == 0:
      p +=[i]
print(p[-k])

Buggy submission (verdict: Runtime Error):
a,b,k =map(int,input().split())
p=[]
for i in range(max(a,b)):
  if i>0:
    if a%i == 0 and b%i == 0:
      p +=[i]
print(p[-k+1])

Buggy submission (verdict: Runtime Error):
a,b,k =map(int,input().split())
p=[]
for i in range(int((a+b)//4)):
  if i>0:
    if a%i == 0 and b%i == 0:
      p +=[i]
print(p[-k+1])
Problem p03126 (python)

Fixed submission:
N,M =map(int,input().split())
se = set(range(M+1))
for i in range(N):
  A = [int(x) for x in input().split()]
  se &= set(A[1:])
print(len(se))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
L=[0]*M
for i in range(N):
  A=[int(x) for x in input().split()]
  for j in range(A[0]):
    L[A[j]] +=1
print(L.count(N))
Problem p03241 (python)

Fixed submission:
import sys
input= sys.stdin.readline

N,M = map(int,input().split())
g=M//N#最大公約数になる可能性のある最大値
for i in range(g):
  if M%(g-i)==0:
    print(g-i)
    exit()
  if M%(N+i)==0:
    print(M//(N+i))
    exit()

Buggy submission (verdict: Runtime Error):
import sys
input= sys.stdin.readline

N,M = map(int,input().split())
g=max(M//N,M**0.5)#最大公約数になる可能性のある最大値
for i in range(g):
  if M%(g-i)==0:
    print(g-i)
    exit()

Buggy submission (verdict: Runtime Error):
import sys
input= sys.sdtin.readline

N,M = map(int,input().split())
g=M//N#最大公約数になる可能性のある最大値
for i in range(g):
  if M%(g-i)==0:
    print(g-i)
    exit()
Problem p03309 (python)

Fixed submission:
import numpy as np
N=int(input())
A=[int(X) for X in input().split()]
B=[]
for i in range(N):
  B +=[A[i]-1-i]
B = np.array(sorted(B))
x = B[N//2]
answer = np.abs(B-x).sum()
print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(X) for X in input().split()]
B=[]
for i in range(N):
  B +=[A[i]-1-i]
B = sorted(B)
p=N//2
answer=float('inf')
for i in range(B[p-1],B[p+2]):
  a=0
  for j in range(N):
    a+=abs(B[j]-i)
  answer=min(answer,a)
print(answer if answer!=float('inf') else 0)

Buggy submission (verdict: Runtime Error):
import statistics
import math

N=int(input())
A=[int(x) for x in input().split()]
def ka(b):
  k=0
  for i in range(N):
    k += abs(A[i]-(b+i+1))
  return k

B=[]
for j in range(N):
  B +=[A[j]-j-1]
B=sorted(B)

result=float('inf')
for k in range(B[N//2],B[N//2+2]):
  result =min(result,ka(k))
print(result)
Problem p03423 (python)

Fixed submission:
n = int(input())
print(n//3)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input().split()
print('Three' if len(set(S))==3 else 'Four')
Problem p03433 (python)

Fixed submission:
N,A=int(input()),int(input())
print('Yes' if N%500<=A else 'No')

Buggy submission (verdict: Runtime Error):
N,A = map(int,input().split())
if N%500<=A:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N,A = map(int,input().split())
if N%500 <= A:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N,A = map(int,input().split())
a = N%500
if a<=A:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N,A = map(int,input().split())
a = N%500
if a<=A:
    print('YES')
else:
    print('no')
Problem p03469 (python)

Fixed submission:
s =str(input())
print('2018/01/' + s[-2:])

Buggy submission (verdict: Runtime Error):
S =str(input())
print('2018/01/' + s[-2:])
Problem p03480 (python)

Fixed submission:
import numpy as np
S=str(input())
X=[]
c=1
for i in range(1,len(S)):
  if S[i]==S[i-1]:
    c +=1
  elif S[i]!=S[i-1]:
    X +=[c]
    c=1
  if i==len(S)-1:
    X +=[c]
if len(S)==1:
  X=[1]
if len(X)>=3:
  X=np.cumsum(X)
  t=float('inf')
  for i in range(len(X)-1):
    u=max(X[i],len(S)-X[i])
    t=min(u,t)
  answer=t
elif len(X)==1:
  answer=X[0]
elif len(X)==2:
  answer=max(X)
print(answer)

Buggy submission (verdict: Runtime Error):
import numpy as np
S=str(input())
X=[]
c=1
for i in range(1,len(S)):
  if S[i]==S[i-1]:
    c +=1
  elif S[i]!=S[i-1]:
    X +=[c]
    c=1
  if i==len(S)-1:
    X +=[c]
if len(X)>=3:
  X=np.cumsum(X)
  t=float('inf')
  for i in range(len(X)-1):
    u=max(X[i],len(S)-X[i])
    t=min(u,t)
  answer=t
elif len(X)==1:
  answer=X[0]
elif len(X)==2:
  answer=max(X)
print(answer)

Buggy submission (verdict: Runtime Error):
S=str(input())
X=[]
c=1
for i in range(1,len(S)):
  if S[i]==S[i-1]:
    c +=1
  elif S[i]!=S[i-1]:
    X +=[c]
    c=1
  if i==len(S)-1:
    X +=[c]
if len(X)>=3:
  if S[0]=='0':
    X.pop(0)
  if S[-1]=='0':
    X.pop(-1)
  P=(len(X)-1)//2
  
  answer= min(X[P-1]+X[P],X[P]+X[P+1])
elif len(X)==1:
  answer=X[0]
elif len(X)==2:
  answer=max(X)
print(answer)
Problem p03493 (python)

Fixed submission:
s = input()
print(s.count('1'))

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

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
result = float('inf') 
for i in a:
    result = min(result,len(bin(i))-bin(i).rfind('1')-1)
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np
input()
x=np.array(input().split(),dttype=np.int32)
ans=0
while (x%2==0).all():
    x//2
    ans +=1
print(answer)
Problem p03550 (python)

Fixed submission:
N,Z,W=map(int,input().split())
A=[int(x) for x in input().split()]
if N==1:
  answer=abs(A[0]-W)
else:
  answer=max(abs(W-A[-1]),abs(A[-1]-A[-2]))
print(answer)

Buggy submission (verdict: Runtime Error):
N,Z,W=map(int,input().split())
A=[int(x) for x in input().split()]
if N==1:
  answer=abs(A[1]-W)
else:
  answer=max(abs(W-A[-1]),abs(A[-1]-A[-2]))
print(answer)

Buggy submission (verdict: Runtime Error):
N,Z,W=map(int,input().split())
A=[int(x) for x in input().split()]
answer=max(abs(W-A[-1]),abs(A[-1]-A[-2]))
print(answer)
Problem p03612 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]
X = [0]*N
answer = 0
for i in range(N):
  if A[i]==i+1:
    X[i]=1
for i in range(N-1):
  if X[i]==1:
    answer +=1
    X[i+1]=0
if X[N-1]==1:
  answer +=1
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]
X = [0]*N
answer = 0
for i in range(N):
  if A[i]==i+1:
    X[i]=1
for i in range(N):
  if X[i]==1:
    answer +=1
    X[i+1]=0
print(answer)
Problem p03644 (python)

Fixed submission:
N = int(input())
print(2**(len(bin(N))-3))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
result = float('inf') 
for i in a:
    result = min(result,len(bin(i))-bin(i).rfind('1')-1)
print(result)
Problem p03693 (python)

Fixed submission:
r,g,b=map(int,input().split())
result = (r*100+g*10+b)%4
if result==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
N,A=int(input()),int(input())
print('Yes' if N%500<=A else 'No')
Problem p03695 (python)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_min==0:
  answer_min=1
print(answer_min,answer_max)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(x) for x in input().split()]
B=[0]*9
for i in range(N):
  R=A[i]//400
  if R>8:
    R=8
  B[R] +=1
answer_min=0
for i in range(8):
  if not B[i]==0:
    answer_min +=1
answer_max=answer_min+B[8]
if answer_max>8:
  answer_max=8
if answer_min=0:
  answer_min=1
print(answer_min,answer_max)
Problem p03778 (python)

Fixed submission:
W,A,B = map(int,input().split())
if A <= B:
  a=A
  b=B
else:
  a=B
  b=A
print(b-a-W if a+W<b else int(0))

Buggy submission (verdict: Runtime Error):
W,A,B = map(int,input().split())
if A <= B:
  a=A
  b=b
else:
  a=B
  b=A
print(b-a-W if a+W<b else int(0))
Problem p02778 (python)

Fixed submission:
S = input()
print('x'*len(S))

Buggy submission (verdict: Runtime Error):
def areDistinct(arr) : 
  
    n = len(arr) 
  
    s = set() 
    for i in range(0, n):  
        s.add(arr[i]) 
      

    return (len(s) == len(arr)) 
  

N = int(input())
S =  [int(x) for x in input().split()]
  
if (areDistinct(S)):  
    print("YES") 
  
else :  
    print("NO")
Problem p03071 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            if ListH[k] < ListH[i]:
                out = True
    if not out :
        result += 1
print(result)
Problem p02983 (python)

Fixed submission:
import numpy as np
l,r = map(int, input().split())
if ((l//2019)<(r//2019)):
  print(0)
else:
  arr1 = np.array(range(l,r+1))
  arr2 = np.array(range(l,r+1)).reshape(r-l+1,1)
  arr = arr1*arr2%2019 + (np.identity(r-l+1)*2019)
  print(int(np.min(arr)))

Buggy submission (verdict: Runtime Error):
import numpy as np
l,r = map(int, input().split())
if ((l-1//2019)<(r//2019))|(((l-1//673)<(r//673))&((l-1//3)<(r//3))):
  print(0)
else:
  arr1 = np.array(range(l,r+1))
  arr2 = np.array(range(l,r+1)).reshape(r-l+1,1)
  arr = arr1*arr2%2019 + (np.identity(r-l+1)*2019)
  print(int(np.min(arr)))

Buggy submission (verdict: Runtime Error):
import numpy as np
l,r = map(int, input().split())
if ((l-1//2019)<(r//2019))|(((l-1//673)<(r//673))&((l-1//3)<(r//3))):
  print(0)
else:
  arr1 = np.array(range(l,r+1))
  arr2 = np.array(range(l,r+1)).reshape(r-l+1,1)
  arr = arr1*arr2%2019
  for i in range(r-l+1):
    arr[i][i] = 2019
  print(np.min(arr))

Buggy submission (verdict: Runtime Error):
import numpy as np
l,r = map(int, input().split())
if (l-1//2019)<(r//2019):
  print(0)
else:
  arr1 = np.array(range(l,r+1))
  arr2 = np.array(range(l,r+1)).reshape(r-l+1,1)
  arr = arr1*arr2%2019
  for i in range(r-l+1):
    arr[i][i] = 2019
  print(np.min(arr))

Buggy submission (verdict: Runtime Error):
import numpy as np
l,r = map(int, input().split())
arr1 = np.array(range(l,r+1))
arr2 = np.array(range(l,r+1)).reshape(r-l+1,1)
arr = arr1*arr2%2019
for i in range(r-l+1):
  arr[i][i] = 2019
print(np.min(arr))
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int, input().split())
p = 0
if (x==0)|(x==w)|(y==0)|(y==h):
  mens = w*h/2
  p = 0
elif (x==(w/2))|(y==(h/2)):
  mens = w*h/2
  if (x==(w/2))&(y==(h/2)):
    p = 1
  else:
    p = 0
elif ((x/y)==(w/h))|(y == -(h/w)*x+h):
  p = 1
  mens = w*h/2
else:
  if ((y<h/w*x)&(y<-(h/w)*x+h))|((y>h/w*x)&(y>-(h/w)*x+h)):
    p = 0
    mens = w*h/2
  else:
    p = 0
    mens = w*h/2
print(mens, p)

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
p = 0
if (x==0)|(x==w)|(y==0)|(y==h):
  mens = 0
  p = 0
if (x==(w/2))|(y==(h/2)):
  mens = w*h/2
  if (x==(w/2))&(y==(h/2)):
    p = 1
  else:
    p = 0
elif ((x/y)==(w/h))|(y == -(h/w)*x+h):
  p = 1
  mens = min(x,w-x)*h
else:
  if ((y<h/w*x)&(y<-(h/w)*x+h))|((y>h/w*x)&(y>-(h/w)*x+h)):
    p = 0
    mens = min(y,h-y)*w
  else:
    p = 0
    mens = min(x,w-x)*h
print(mens, p)
Problem p03005 (python)

Fixed submission:
n,k = map(int, input().split())
if k==1:
  print(0)
else:
  print(n-k)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
if k=1:
  print(0)
else:
  print(n-k)
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())
x = ""
for i in range(n):
  if s[i] == s[k-1]:
    x = x+s[i]
  else:
    x = x+"*"
print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
x = ""
for i in range(n):
  if s[i] == s[k]:
    x = x+s[i]
  else:
    x = x+"*"
print(x)
Problem p02830 (python)

Fixed submission:
n = int(input())
w, x = input().split(" ")
s = str(w)
t = str(x)

new_str = ""

for i in range(0, n):
    new_str += s[i]
    new_str += t[i]

print(new_str)

Buggy submission (verdict: Runtime Error):
n = int(input())
w, x = input().split(" ")
s = str(w)
t = str(x)

new_str = ""

for i in range(0, 3):
    new_str += s[i]
    new_str += t[i]

print(new_str)
Problem p03049 (python)

Fixed submission:
def solve():
    N = int(input())
    words = ["a"]*N
    for i in range(N):
        words[i] = list(input())
    A_list = []
    B_list = []
    AB_list = [] 
    AB_count = 0
    for i in range(N):
        tag_A = tag_B = tag_AB = 0
        for j in range(len(words[i])):
            if words[i][j] == "A" and j == len(words[i])-1:
                tag_A = 1
                tag_AB = 0
            elif words[i][j] == "A":
                tag_AB = 1
            elif words[i][j] == "B" and tag_AB == 1:
                tag_AB = 0
                AB_count += 1
            elif words[i][j] == "B" and j == 0:
                tag_B = 1
                tag_AB = 0
            else:
                tag_AB = 0
        if tag_A == 1 and tag_B == 1:
            AB_list.append(i)
        elif tag_A == 1:
            A_list.append(i)
        elif tag_B == 1:
            B_list.append(i)

    if len(AB_list) > 0 and len(A_list) > 0 and len(B_list) > 0:
        count = AB_count + len(AB_list) + min(len(A_list),len(B_list))
    elif len(AB_list) > 0 and len(A_list) == 0 and len(B_list) == 0:
        count = AB_count + len(AB_list) -1
    elif len(AB_list) > 0 and (len(A_list) == 0 or len(B_list) == 0):
        count = AB_count + len(AB_list)
    else:
        count = AB_count + min(len(A_list),len(B_list))

    print(count)


solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    words = ["a"]*N
    for i in range(N):
        words[i] = list(input())
    A_list = []
    B_list = []
    AB_list = [] 
    AB_count = 0
    for i in range(N):
        tag_A = tag_B = tag_AB = 0
        for j in range(len(words[i])):
            if words[i][j] == "A" and j == len(words[i])-1:
                tag_A = 1
                tag_AB = 0
            elif words[i][j] == "A":
                tag_AB = 1
            elif words[i][j] == "B" and tag_AB == 1:
                tag_AB = 0
                AB_count += 1
            elif words[i][j] == "B" and j == 0:
                tag_B = 1
                tag_AB = 0
            else:
                tag_AB = 0
        if tag_A == 1 and tag_B == 1:
            AB_list.append(i)
        elif tag_A == 1:
            A_list.append(i)
        elif tag_B == 1:
            B_list.append(i)
        #print(tag_A,tag_B,AB_count,A_list,B_list,AB_list)

    if len(AB_list) > 0 and len(A_list) > 0 and len(B_list) > 0:
        count = AB_count + len(AB_list) + min(len(A_list),len(B_list))
    elif len(AB_list) > 0 and len(A_list) == 0 and len(B_list) == 0:
        count = AB_count + len(AB_list) -1
    elif len(AB_list) > 0 and (len(A_list) == 0 or len(B_list) == 0):
        count = AB_count + len(AB_list)
    else:
        count = AB_count + min(len(A_list),len(B_list))

    print(count)


 solve()
Problem p03059 (python)

Fixed submission:
def solve():
    A,B,T = map(int,input().split())
    num = B*int(T/A)
    print(num)


solve()

Buggy submission (verdict: Runtime Error):
def solve():
    A,B,T = int(input().split())
    num = B*int(T/A)
    print(num)


solve()
Problem p03060 (python)

Fixed submission:
def solve():
    N = int(input())
    V = list(map(int,input().split()))
    C = list(map(int,input().split()))
    cnt=0
    for i in range(len(V)):
        if V[i] < C[i]:
            pass
        else:
            cnt += V[i]-C[i]
    print(cnt)


solve()

Buggy submission (verdict: Runtime Error):
def solve():
    N = int(input())
    V = list(map(int,input().split()))
    C = list(map(int,input().split()))
    cnt=0
    for i in range(len(V)):
        if V < C:
            pass
        else:
            cnt += V(i)-C(i)
    print(cnt)


solve()
Problem p02783 (python)

Fixed submission:
H,A=map(int,input().split())

if H%A==0:
  print(H // A)
else:
  print((H // A)+1)

Buggy submission (verdict: Runtime Error):
H,A=int(input())
  
print((H // A)+1)
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())
print(T+S)

Buggy submission (verdict: Runtime Error):
S, T = map(str(), input().split())
print(T + S)