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

Fixed submission:
a = input()
b = input()
count = 0
for i in range(len(a)):
    if b[i] != a[i]:
        count +=  1
print(count)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
count = 0
for i in a:
    if b[i] != a[i]:
        b[i] = a[i]
        count +=  1
print(count)
Problem p02729 (python)

Fixed submission:
import math

N,M = map(int,input().split())
#Nは偶数
#Mは奇数

#偶数偶数
if N >= 2:
  Nf = math.factorial(N)//(math.factorial(N-2)*2)
else:
  Nf = 0
#奇数奇数
if M >= 2:
  Mf = math.factorial(M)//(math.factorial(M-2)*2)
else:
  Mf = 0
ans = int(Nf + Mf)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

N,M = map(int,input().split())
#Nは偶数
#Mは奇数

#偶数偶数
Nf = math.factorial(N)/math.factorial(N-2)/2

#奇数奇数
Mf = math.factorial(M)/math.factorial(M-2)/2

ans = int(Nf + Mf)

print(ans)
Problem p02596 (python)

Fixed submission:
k = int(input())
if(k%2==0 or k%5==0):
    print(-1)
    exit()
else:
    i=1
    seven=7%k
    while seven!=0:
        seven = (seven*10+7)%k
        i+=1
    print(i)

Buggy submission (verdict: Runtime Error):
K = int(input())
if(K%2==0):
    print(-1)
    exit()
check=list(str(K))
if(check[-1]=='5'):
    print(-1)
    exit()
else:
    seven=7
    if(int(''.join(['7']*(K-1)))%K==0):
        print(K-1)
        exit()
    while True:
        if(seven%K==0):
            print(len(str(seven)))
            break
        else:
            seven=seven*10+7
Problem p02623 (python)

Fixed submission:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A_sum = [0]
B_sum = [0]
A_sum.extend(A)
B_sum.extend(B)
for i in range(1,N+1):
    A_sum[i]+=A_sum[i-1]
for i in range(1,M+1):
    B_sum[i]+=B_sum[i-1]
ans,j=0,M
for i in range(N+1):
    if A_sum[i]>K:
        break
    while B_sum[j]+A_sum[i]>K:
        j-=1
    ans = max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
time = 0
count = 0
Ain = 0
Bin = 0
if(min(min(A),min(B))>K):
    print(0)
    exit()
while time<=K:
    if(len(A)!=0 and len(B)!=0):
        if(A[Ain]<B[Bin]):
            time+= A[Ain]
            Ain+=1
            count +=1
        elif(A[Ain]>B[Bin]):
            time += B[Bin]
            Bin+=1
            count+=1
    if((len(A)==0) and (len(B)==0)):
        break
    elif(len(A)==0):
        time += B[Bin]
        Bin += 1
        count += 1
    elif(len(B)==0):
        time += A[Ain]
        Ain += 1
        count += 1
if(time == K):
    print(count)
else:
    print(count-1)
Problem p02682 (python)

Fixed submission:
import numpy as np
A,B,C,K=map(int,input().split())
if(A>=K):
    print(K)
elif(A+B>=K):
    print(A)
else:
    print(A-(K-(A+B)))

Buggy submission (verdict: Runtime Error):
import numpy as np
A,B,C,K=map(int,input().split())
total=np.array([0]*(A+B+C))
total[0:A]=1

total[A+1:A+B]=0
total[A+B:A+B+C]=-1
print(sum(total[0:K]))
Problem p02754 (python)

Fixed submission:
N,A,B = map(int,input().split())
count=N//(A+B)
plus = N%(A+B)
print(A*count+min(A,plus))

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
color = []
if(A==0):
    print(0)
else:
    while len(color)<N:
        color.extend([1]*A)
        color.extend([0]*B)
    print(color[:N].count(1))
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
a = [0]*(N+2)
pass_list = [0]*(N+2)

for i in range(M):
    b = int(input())
    a[b] = 1
if(a[1] !=1):
    pass_list[1]=1
if(a[2] !=1):
    pass_list[2]=1
for i in range(2,N+1):
    if(a[i] != 1):
        pass_list[i] += pass_list[i-1]+pass_list[i-2]
print(pass_list[N]%1000000007)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [0]*(N+1)
pass_list = [0]*(N+1)
for i in range(M):
    b = int(input())
    a[b] = 1
if(a[1] !=1):
    pass_list[1]=1
if(a[2] !=1):
    pass_list[2]=1
for i in range(2,N+1):
    if(a[i] != 1):
        pass_list[i] += pass_list[i-1]+pass_list[i-2]
print(pass_list[N]%1000000007)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
check = False
a = []
pass_list = [0]*(N+1)
a.append(int(input()))
for i in range(1,M):
    a.append(int(input()))
    
if(1 not in a):
    pass_list[1]=1
if(2 not in a):
    pass_list[2]=1
for i in range(2,N+1):
    if(i not in a):
        pass_list[i] += pass_list[i-1]+pass_list[i-2]
print(pass_list[N]%1000000007)
Problem p02596 (python)

Fixed submission:
k = int(input())
ans = 1
seen = set()
mod = 7%k
while mod != 0 and mod not in seen:
    seen.add(mod)
    mod = (10*mod + 7)%k
    ans += 1

if mod == 0:
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
seen = set()
ans = 0
res = 7%n
seen.add(res)
ans += 1
while res != 0:
	new = (res*10 + 7)%n
    if new not in seen:
		seen.add(new)
        res = new
        ans += 1
	else:
    	print(-1):
        exit()
print(ans)
Problem p02820 (python)

Fixed submission:
n, k = map(int, input().split())
r, ss, p = map(int, input().split())
s = input()
hands = [None]*n
wins = {'r':'p', 's':'r', 'p':'s'}
h_s = {'r':r, 's':ss, 'p':p}
ans = 0
for i, c in enumerate(s):
    if i - k >= 0:
        if wins[c] == hands[i-k]:
            hs = set(wins.keys())
            hs.remove(wins[c])
            if i + k < n:
                if wins[s[i+k]] in hs:
                    hs.remove(wins[s[i+k]])
            hands[i] = hs.pop()
            continue
    hand = wins[c]
    hands[i] = hand
    ans += h_s[hand]

print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, ss, p = map(int, input().split())
s = input()
hands = [None]*n
wins = {'r':'p', 's':'r', 'p':'s'}
h_s = {'r':r, 's':ss, 'p':p}
ans = 0
for i, c in enumerate(s):
    if i - k >= 0:
        if wins[c] == hands[i-k]:æ
            hs = set(wins.keys())
            hs.remove(wins[c])
            if i + k < n:
                if wins[s[i+k]] in hs:
                    hs.remove(wins[s[i+k]])
            hands[i] = hs.pop()
            continue
    hand = wins[c]
    hands[i] = hand
    ans += h_s[hand]

print(ans)
Problem p03013 (python)

Fixed submission:
import sys
sys.setrecursionlimit(200000)
def num_steps(steps, cache={}):
    if steps in out or steps < 0 :
        return 0
    elif steps == 0:
        return 1

    if steps in cache:
        return cache[steps]
    else:
        one = num_steps(steps-1, cache)
        two = num_steps(steps-2, cache)
        ans = one + two
        cache[steps] = ans

        return ans%mod

n, m = map(int, input().split())
out = set(int(input()) for _ in range(m))
mod = 1000000007

print(num_steps(n))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
def num_steps(steps, cache={}):
    if steps in out or steps < 0 :
        return 0
    elif steps == 0:
        return 1

    if steps in cache:
        return cache[steps]
    else:
        one = num_steps(steps-1, cache)
        two = num_steps(steps-2, cache)
        ans = one + two
        cache[steps] = ans

        return ans%mod

n, m = map(int, input().split())
out = set(int(input()) for _ in range(m))
mod = 1000000007

print(num_steps(n))

Buggy submission (verdict: Runtime Error):
def num_steps(steps, cache={}):
    if steps in out or steps < 0 :
        return 0
    elif steps == 0:
        return 1

    if steps in cache:
        return cache[steps]
    else:
        one = num_steps(steps-1, cache)
        two = num_steps(steps-2, cache)
        ans = one + two
        cache[steps] = ans

        return ans%mod

n, m = map(int, input().split())
out = set(int(input()) for _ in range(m))
mod = 1000000007

print(num_steps(n))
Problem p02570 (python)

Fixed submission:
data = input()
n = [int(x) for x in data.split()]
if n[1] * n[2] < n[0]: print("No")
else: print("Yes")

Buggy submission (verdict: Runtime Error):
data = input()
n = [int(x) for x in data]
if n[1] * n[2] < n[0]: print("No")
else print("Yes")
Problem p02676 (python)

Fixed submission:
k = int(input())
s = input()
print(s[0:k] + "..." if len(s) > k else s)

Buggy submission (verdict: Runtime Error):
i = int(input())
s = input()
print(s[0:k-1] if len(s) > k else s)
Problem p02693 (python)

Fixed submission:
k = int(input())
data = input().split()
a = int(data[0])
b = int(data[1])
 
ans = False
 
if abs(a - b) > k:
  ans = True
else:
  for i in range(a, b + 1):
    if i % k == 0:
      ans = True
      break
print("OK" if ans else "NG")

Buggy submission (verdict: Runtime Error):
k = int(input())
data = input.split()
a = data[0]
b = data[1]

if a - b > k:
  print("OK")
else:
  ans = False
  for i in range(a, b + 1):
    if i % k == 0:
      ans = True
  print("OK" if ans else "NG")
Problem p02723 (python)

Fixed submission:
data = input()
 
if data[2] == data[3] and data[4] == data[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
data = input()

if data[3] == data[4] and data[5] == data[6]:
  print("Yes")
else:
  print("No")
Problem p02753 (python)

Fixed submission:
com = input()
if com[0] == com[1] == com[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
data = input().split()
 
a = int(data[0])
b = int(data[1])
 
pricea = a // 0.08
priceb = b // 0.1
 
if pricea == priceb:
  ans = pricea
elif pricea + 1 == priceb:
  ans = priceb
elif pricea == priceb + 1:
  ans = pricea
else:
  ans = -1
  
print(ans)
Problem p02790 (python)

Fixed submission:
data = input().split()
 
a = data[0]
b = data[1]
 
ans = min(a, b) * int(max(a, b))
 
print(ans)

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

a = data[0]
b = data[1]

ans = min(a, b) * max(a, b)

print(ans)
Problem p02831 (python)

Fixed submission:
import fractions
 
data = input().split()
val = [int(n) for n in data]
 
res = val[0] * val[1] / fractions.gcd(val[0], val[1])
 
print(int(res))

Buggy submission (verdict: Runtime Error):
import math

data = input().split()
val = [int(n) for n in data]

res = val[0] * val[1] / math.gcd(val[0], val[1])

print(res)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

if n % 2 == 1:
  print("No")
elif s[:(int)(n/2)] == s[(int)(n/2):]:
  print("Yes")
else:
  print("No")

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

if(s[:n/2-1] == s[n/2:]):
  print("Yes")
else:
  print("No")
Problem p03634 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
edge = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b, c = [int(t) for t in input().split()]
    edge[a].append((b, c))
    edge[b].append((a, c))

Q, K = [int(t) for t in input().split()]

def dfs(s):
    '''Kからの距離を計算'''
    global dist
    work = [s]
    while len(work) > 0:
        s = work.pop()
        for t, c in edge[s]:
            if dist[t] == None:
                dist[t] = dist[s] + c
                work.append(t)

dist = [None] * (N + 1)  # Kからの距離
dist[K] = 0
dfs(K)

for i in range(Q):
    x, y = [int(t) for t in input().split()]
    print(dist[x] + dist[y])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
edge = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b, c = [int(t) for t in input().split()]
    edge[a].append((b, c))
    edge[b].append((a, c))

Q, K = [int(t) for t in input().split()]

def dfs(s):
    '''深さ優先探索でKからの距離を計算'''
    global dist
    for t, c in edge[s]:
        if dist[t] == None:
            dist[t] = dist[s] + c
            dfs(t)

dist = [None] * (N + 1)  # Kからの距離
dist[K] = 0
dfs(K)

for i in range(Q):
    x, y = [int(t) for t in input().split()]
    print(dist[x] + dist[y])
Problem p02753 (python)

Fixed submission:
s = input()
ans = 'Yes'

if(s == 'AAA' or s == 'BBB'):
    ans = 'No'

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 'Yes'

if(s == 'AAA' || s == 'BBB'):
    ans = 'No'

print(ans)
Problem p03345 (python)

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

ans = a - b

if(k % 2 == 1):
    ans = b - a

print(ans)

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

ans = a - b

if(k % 2 == 1):
    ans = abs(ans)

if(len(ans) >= 18):
    ans = 'Unfair'

print(ans)
Problem p02688 (python)

Fixed submission:
N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i+1) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for kun in sunukekun:
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))

Buggy submission (verdict: Runtime Error):
N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))

Buggy submission (verdict: Runtime Error):
N, K = input().split(' ')

sunukekuns = [i for i in range(N)]

for k in range(K):
  _, sunukekun = input(), input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))
Problem p02754 (python)

Fixed submission:
# N, A, B
num, greenNum, redNum = map(lambda x: int(x), input().split(' '))

numSet = num // (greenNum+redNum)
remain = num % (greenNum+redNum)
numRest = remain if (remain < greenNum) else greenNum

totalGreen = numSet * greenNum + numRest

print(totalGreen)

Buggy submission (verdict: Runtime Error):
# N
num = int(input())
# A
greenNum = int(input())
# B
redNum = int(input())

# output
totalGreen = 0
while (num > 0):
  if (num <= greenNum):
    totalGreen += num
    num = 0
  else:
    totalGreen += greenNum
    num -= (greenNum + redNum)
    
print(totalGreen)
Problem p03072 (python)

Fixed submission:
def countInn(n, L):
  numInn = 1
  mainHurdle = L[0]
  hurdle = mainHurdle
  for i in range(1, n):
    currentH = L[i]
    if currentH < mainHurdle or currentH < hurdle:
      continue
    numInn += 1
    hurdle = currentH
  print(numInn)
  
n = int(input())
a = list(map(int, input().split()))
countInn(n, a)

Buggy submission (verdict: Runtime Error):
def countInn(n, L):
  numInn = 1
  mainHurdle = L[0]
  hurdle = L[1]
  for i in range(1, n):
    currentH = L[i]
    if currentH < mainHurdle or currentH < hurdle:
      continue
    numInn += 1
    hurdle = currentH
  print(numInn)
  
n = int(input())
a = list(map(int, input().split()))
countInn(n, a)

Buggy submission (verdict: Runtime Error):
def countInn(n, L):
  numInn = 1
  mainHurdle = L[0]
  hurdle = L[1]
  for i in range(1, n):
    currentH = L[i]
    if currentH < mainHurdle or currentH < hurdle:
      continue
    numInn += 1
    hurdle = currentH
  print(numInn)
  
n = int(input())
a = list(map(int, input().split()))
countInn(n, a)
Problem p03073 (python)

Fixed submission:
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*(len(S)//2)
else:
  sample = unit*(len(S)//2)+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*len(S)//2
else:
  sample = unit*len(S)//2+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
if len(S) % 2 == 0:
  whiteS = '01'*len(S)//2
  blackS = '10'*len(S)//2
else:
  whiteS = '01'*len(S)//2 + '0'
  blackS = '10'*len(S)//2 + '1'
  
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*len(S)//2
else:
  sample = unit*len(S)//2+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)
Problem p02577 (python)

Fixed submission:
N = input()
check = 0

for i in N:
    check += int(i)

if check % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
check = 0
for i in N:
  check += i
if check % 9 == 0:
  print("Yes")
else:
  print("No")
Problem p02580 (python)

Fixed submission:
from collections import defaultdict as ddict

ii=jj=0
ia,ja=[],[]
rows=ddict(int)
cols=ddict(int)
H,W,M=map(int,input().split())
tgts=set()
for _ in range(M):
    i,j=map(int,input().split())
    tgts.add((i,j))

    rows[i]+=1
    cols[j]+=1
    x=rows[i]
    if x>ii:
        ii=x
        ia=[i]
    elif x==ii:
        ia.append(i)
    y=cols[j]
    if y>jj:
        jj=y
        ja=[j]
    elif y==jj:
        ja.append(j)



ans=0
for i in ia:
    for j in ja:
        k=rows[i]+cols[j]
        if (i,j) in tgts:
            k-=1
        else:
            ans=k
            break
        ans=max(ans,k)

print(ans)

Buggy submission (verdict: Runtime Error):
h,w,m=map(int,input().split())

c=[0]*w
r=[0]*h
s=set()
for _ in range(m):
    i,j=map(int,input().split())
    i-=1
    j-=1
    r[i]+=1
    c[j]+=1
    s.add(i*w+j)

rmx=max(r)
cmx=max(c)
rc=[i for i in range(w) if r[i]==rmx]
cc=[j for j in range(h) if c[j]==cmx]

ans=rmx+cmx-1
ok=False
for i in rc:
    for j in cc:
        if i*w+j not in s:
            ans+=1
            ok=True
            break
    if ok:
        break

print(ans)
Problem p02597 (python)

Fixed submission:
import sys

N=int(input())
s=list(input().strip())

#print(s)

k=0
i,j=0,N-1
while i<j:
    if s[i]=='R':
        i+=1
    elif s[j]=='W':
        j-=1
    else:
        s[i]='W'
        s[j]='R'
        k+=1
        i+=1
        j-=1

print(k)

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

ans=0
i,j=0,N-2
while i<j:
    if s[i]=='R':
        i+=1
    elif s[j]=='W':
        j-=1
    else:
        k+=1
        i+=1
        j-=1

print(k)
Problem p02622 (python)

Fixed submission:
S=input()
T=input()
print(sum(x!=y for x,y in zip(S,T)))

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
print(sum(x!=y for x,y in zip(S,T))
Problem p02571 (python)

Fixed submission:
#_______________________________________________________________#
def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x-1)
def lower_bound(li, num): 
	answer = -1
	start = 0
	end = len(li)-1

	while(start <= end):
		middle = (end+start)//2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer #index where x is not less than num
def upper_bound(li, num): 
	answer = -1
	start = 0
	end = len(li)-1

	while(start <= end):
		middle = (end+start)//2

		if li[middle] <= num:
			answer = middle
			start = middle + 1
		
		else:
			end = middle - 1
	return answer #index where x is not greater than num

def abs(x):
	return x if x >=0 else -x
def binary_search(li, val, lb, ub): 
	ans = 0
	while(lb <= ub):
		mid = (lb+ub)//2
		#print(mid, li[mid])
		if li[mid] > val:
			ub = mid-1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans
def kadane(x): #maximum sum contiguous subarray
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = mpos(sum_so_far,current_sum)
	return sum_so_far
def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

#_______________________________________________________________#
'''
      ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ▄███████▀▀▀▀▀▀███████▄
░▐████▀▒▒Aestroix▒▒▀██████
░███▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀████
░▐██▒▒▒▒▒KARMANYA▒▒▒▒▒▒████▌         ________________
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌  ? ?   |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒|
░░█▒▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▒▐███▌   ?    |___CM ONE DAY___|
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▒▐███▌     ? ? |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒|
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌    ? ?    
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌      ? 
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█     ? ? 
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀       ? 
░░░░▄█████████ ████=========█▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
░░░░░████████████████
'''
from math import *
#for _ in range(int(input())):
for _ in range(1):
	#n = int(input())
	#p,f = map(int,input().split())
	#d,t,s = map(int,input().split())
	#ws,wa = map(int,input().split())
	#b = list(input())
	#x = int(input())
	#n = len(b)
	#s2 = input()
	#r, g, b, w = map(int,input().split())
	#a = list(map(int,input().split()))
	#b = list(map(int,input().split()))
	#s1 = list(st)
	s = input()
	t = input()
	n = len(s)
	m = len(t)
	cnt = 10000
	for i in range(n-m+1):
		st = s[i:i+m]
		if st == t:
			cnt = 0
			break
		else:
			temp = 0
			for j in range(m):
				if st[j] != t[j]:
					temp += 1
			cnt = min(cnt,temp)
	print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
n = len(s)
m = len(t)
cnt = 10000
for i in range(n-m+1):
	st = s[i:i+m]
    if st == t:
      cnt = 0
      break
    else:
      temp = 0
      for j in range(m):
        if t[j] != st[j]:
          temp += 1
      cnt = min(cnt,temp)
print(cnt)
Problem p02570 (python)

Fixed submission:
d,t,s = input().split()
if int(d)/int(s) <= int(t): 
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
d,t,s = input().split()
if d/s <= t: 
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
d,t,s = int(input().split())
if d/s <= t: 
    print("Yes")
else:
    print("No")
Problem p02580 (python)

Fixed submission:
H, W, m = map(int, input().split())
xs = [0] * H
ys = [0] * W
s = set()
for _ in range(m):
    h, w = map(int, input().split())
    h -= 1
    w -= 1
    xs[h] += 1
    ys[w] += 1
    s.add((h, w))

mx = max(xs)
my = max(ys)
mxs = set()
for i in range(H):
    if xs[i] == mx:
        mxs.add(i)
mys = set()
for i in range(W):
    if ys[i] == my:
        mys.add(i)
for x in mxs:
    for y in mys:
        if not (x, y) in s:
            print(mx + my)
            exit()
print(mx + my - 1)

Buggy submission (verdict: Runtime Error):
H, W, m = map(int, input().split())
xs = [[0] * W for _ in range(H)]
for _ in range(m):
    h, w = map(int, input().split())
    xs[h - 1][w - 1] += 1

mxx = [0] * H
for i in range(H):
    sm = 0
    for j in range(W):
        sm += xs[i][j]
    mxx[i] = sm
mxy = [0] * W
for i in range(W):
    sm = 0
    for j in range(H):
        sm += xs[j][i]
    mxy[i] = sm
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, mxx[i] + mxy[j] - xs[i][j])
print(ans)

Buggy submission (verdict: Runtime Error):
H, W, m = map(int, input().split())
xs = [[0] * W for _ in range(H)]
for _ in range(m):
    h, w = map(int, input().split())
    xs[h - 1][w - 1] += 1

mxx = [0] * H
for i in range(H):
    mxx[i] = sum(xs[i])
mxy = [0] * W
for i in range(W):
    sm = 0
    for j in range(H):
        sm += xs[j][i]
    mxy[i] = sm
ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, mxx[i] + mxy[j] - xs[i][j])
print(ans)
Problem p02570 (python)

Fixed submission:
d, t, s = map(int, input().split())
if d/s <= t: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
start, end = 0, len(t)
def f(s, t, start, end):
    min_changes = len(t)
    if start + len(t) == len(s):
        count = 0
        for i in range(len(t)):
            if s[start:end][i] != t[i]: count += 1
        return min(count, min_changes)
    return min(f(s, t, start+1, end+1), min_changes)

print(f(s, t, start, end))