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

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

if a<3200:
  s = 'red'

print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))

li = sorted(li)
tmp = li[0]

for i in range(1,N):
  tmp = (tmp + li[i]) / 2

print(tmp)
Problem p03042 (python)

Fixed submission:
a,b,c,d = input()

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 in range(1,13)) and (int2 in range(1,13)):
    ans = 'AMBIGUOUS'
elif (int1 in range(1,13)) and (int2 not in range(1,13)):
    ans = 'MMYY'
elif (int2 in range(1,13)) and (int1 not in range(1,13)):
    ans = 'YYMM'
else:
    ans = 'NA'

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 and int2 == 0):
    ans = 'NA'
elif (int1 > 12 and int2 == 0):
    ans = 'NA'
elif (int1 > 12):
    ans = 'YYMM'
elif (int2 > 12 and int1 == 0):
    ans = 'NA'
elif (int2 > 12):
    ans = 'MMYY'
elif:
    ans = 'AMBIGUOUS'

print(ans)
Problem p02546 (python)

Fixed submission:
s=input()
if s[-1]=='s':
    print(s,'es',sep='')
else:
    print(s,'s',sep='')

Buggy submission (verdict: Runtime Error):
s=list(input())
if s[-1]=='s':
    print(s+'es')
else:
    print(s+'s')
Problem p02547 (python)

Fixed submission:
n=int(input())
k=0
l=0
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        k += 1
        if k==3:
            print('Yes')
            exit()
    else:
        k = 0
print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(n):
    a,b=list(map(int,input().split()))
for i in range(n-2):
    if a[i]==b[i] and a[i+1]==b[i+1] and a[i+2]==b[i+2]:
        print('Yes')
        exit()
print('No')
Problem p02572 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans = 0
last = 0

for i in range(N):
    ans += A[i]*A[i]
last += sum(A)*sum(A)
last -= ans
last //= 2
print(last % 1000000007)

Buggy submission (verdict: Runtime Error):
n=int(input())
ai = list(map(int,input().split()))
sum = 0
i=0
k=1
while i<n-1:
    while k<n-i:
    sum += ai[i]*ai[i+k]
    k++
  i++
sum %= 1000000007
print(sum)
Problem p02676 (python)

Fixed submission:

k=int(input())
s=input()
l=len(s)
if l<=k:
    print(s)
else:
    print(s[:k]+"...")

Buggy submission (verdict: Runtime Error):
k = int,input()
l = input()
if(len(l)<k):
    print(l)
else:
    print(l)
    print("...")
Problem p02711 (python)

Fixed submission:
n = input()
if '7' in n:print('Yes')
else:print('No')

Buggy submission (verdict: Runtime Error):
n = map(int,input.split())
if '7' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = map(int,input.split())
if 7 in n:print('Yes')
else:print('No')
Problem p02723 (python)

Fixed submission:
s=list(input())
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=list(map(str,input().split()))
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
Problem p02766 (python)

Fixed submission:
n,k=map(int,input().split())
count=0
while n !=0:
    n //= k
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
count=0
while int(m)!=0:
    int(m)= n/k
    n=int(m)
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
count=0
while m!=0:
    int(m) = n/k
    n=m
    count += 1
print(count)
Problem p02879 (python)

Fixed submission:

a,b=map(int,input().split())
if a<10 and b<10:
    print(a*b)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(9):
    for j in range(9):
        k = (i+1)*(j+1)
        if n%k==0:
            print('Yes')
        else:
            print('No')
Problem p02880 (python)

Fixed submission:
n=int(input())
for i in range(9):
    for j in range(9):
        k = (i+1)*(j+1)
        if n==k:
            print('Yes')
            exit()
        else:
            continue
print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(9):
    for j in range(9):
        k = i*j
        if n%k==0:
            print('Yes')
            exit()
        else:
            continue
print('No')

Buggy submission (verdict: Runtime Error):

n=int(input())
for i in range(9):
    for j in range(9):
        if n%(i*j)==0:
            print('Yes')
        else:
            print('No')
Problem p03135 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
L=list(map(int,input().split()))
L.sort()
ans=sum(L)-L[n-1]
if ans>L[n-1]:
    print('Yes')
else:
    print('No')
Problem p03327 (python)

Fixed submission:

n=int(input())
if n < 1000:
    print('ABC')
else:
    print('ABD')

Buggy submission (verdict: Runtime Error):

n=input()
if n < 1000:
    prnt('ABC')
else:
    print('ABD')
Problem p03135 (python)

Fixed submission:
num1, num2 = (int(i) for i in input().split())

ans = float(num1) / float(num2)

print(ans)

Buggy submission (verdict: Runtime Error):
num1 = input("input num1 :")

num2 = input("input num2 :")

ans = float(num1) / float(num2)

print(ans)
Problem p03137 (python)

Fixed submission:
N ,M = input().split()
X = list(map(int, input().split()))
ans = 0
if int(N) >= int(M):
    print(ans)
else:
    X.sort()
    #print(X)
    div = []
    for i in range(int(M)-1):
        #print(i)
        div.append(abs(X[i + 1] - X[i]))
    div.sort()
    #print(div)
    for i in range(int(N)-1):
        div.pop()
    #print(div)
    for i in div:
        ans += i
    print(ans)

Buggy submission (verdict: Runtime Error):
N ,M = input().split()
X = list(map(int, input().split()))
X.sort()
#print(X)
ans = 0
div = []
sliceNo = []
for i in range(int(M)-1):
    #print(i)
    div.append(abs(X[i + 1] - X[i]))
div.sort()
#print(div)
for i in range(int(N)-1):
    div.pop()
#print(div)
for i in div:
    ans += i
print(ans)
Problem p02790 (python)

Fixed submission:
a, b = input().split()
if int(a[0]) < int(b[0]):
    print(a * int(b))
else:
    print(b * int(a))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())a, b = map(int, input().split())
if a[0] < b[0]:
    print(a)
else:
    print(b)
Problem p03631 (python)

Fixed submission:
A,B,C=input()
if int(A)==int(C):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
if A == C:
  print('Yes')
else:
  print('No')
Problem p02891 (python)

Fixed submission:
def calc(S, T):
    U = [(S[0], 1)]
    un = 0
    for i in range(1, len(S)):
        if U[un][0] == S[i]:
            U[un] = (U[un][0], U[un][1] + 1)
        else:
            U += [(S[i], 1)]
            un += 1
    if un == 0:
        return (U[0][1] * T) // 2
    else:
        if U[0][0] != U[un][0]:
            return sum([u[1] // 2 for u in U]) * T
        else:
            return U[0][1] // 2 + U[un][1] // 2 \
                + (U[0][1] + U[un][1]) // 2 * (T - 1) \
                + sum([u[1] // 2 for u in U[1:un]]) * T


S = input()
T = int(input())
print(calc(S, T))

Buggy submission (verdict: Runtime Error):
def calc(S, T):
    U = [(S[0], 1)]
    un = 0
    for i in range(1, len(S)):
        if U[un][0] == S[i]:
            U[un] = (U[un][0], U[un][1] + 1)
        else:
            U += [(S[i], 1)]
            un += 1
    U = [u for u in U if u[1] > 1]
    un = len(U) - 1
    if un == 0:
        return (U[0][1] * T) // 2
    else:
        if U[0][0] != U[un][0]:
            return sum([u[1] // 2 for u in U]) * T
        else:
            return U[0][1] // 2 + U[un][1] // 2 \
                + (U[0][1] + U[un][1]) // 2 * (T - 1) \
                + sum([u[1] // 2 for u in U[1:un]]) * T


S = input()
T = int(input())
print(calc(S, T))
Problem p02990 (python)

Fixed submission:
import math as m

Z = 10 ** 9 + 7


def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    K1_fact = m.factorial(K - 1)
    result = ''
    for i in range(1, K + 1):
        if (M - i < 0):
            val = 0
        else:
            val = M_fact // m.factorial(i) // m.factorial(M - i) * \
                K1_fact // m.factorial(i - 1) // m.factorial(K - i)
        result += "{}\n".format(
            val if val < Z else val % Z
        )
    print(result)


s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)

Buggy submission (verdict: Runtime Error):
import math as m

Z = 10 ** 9 + 7

def conb(S, i):
    if (i == 1):
        return 1
    elif (i == 2):
        return S - 1
    elif (i == 3):
        return (S - 1) * (S - 2) // 2
    else:
        n = 0
        for j in range(1, S - i + 2):
            n += conb(S - j, i - 1)
        return n

def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    result = ''
    for i in range(1, K + 1):
        val = m.factorial(M) // m.factorial(i) // m.factorial(M - i) * conb(K, i)
        result += "{}\n".format(
            val if val < Z else val % Z
            )
    print(result)

s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)
Problem p02547 (python)

Fixed submission:
N = int(input())
D = []
for i in range(N):
    a = list(map(int,input().split()))
    if(a[0] == a[1]):
        D.append(1)
    else:
        D.append(0)
tf = 0
for i in range(N-2):
    if D[i] == D[i+1] == D[i+2] == 1:
        tf = 1
if tf == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
D = []
for i in range(N):
    a = list(map(int,input().split()))
    if(a[0] == a[1]):
        D.append(1)
    else:
        D.append(0)
for i in range(N-2):
    if D[i] == D[i+1] == D[i+2] == 1:
        tf = 1
if tf == 1:
    print("Yes")
else:
    print("No")
Problem p02572 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
tmp = sum(A)
for i in range(N):
    tmp -= A[i]
    add += tmp * A[i]
print(add%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
for i in range(N):
    tmp = sum(A[i+1:N])
    add += tmp * A[i]
print(add%mod
Problem p02729 (python)

Fixed submission:
N,M = map(int,input().split())
s = t = 0
for i in range(N):
    s += i
for i in range(M):
    t += i
print(s+t)

Buggy submission (verdict: Runtime Error):
N = int(input())
C = list(map(int,input().split()))

def chose(A):
    s = 0
    t = 0
    for i in range(len(A)):
        t = A.count(i+1) 
        for q in range(t):
            s += q
    print(s)

for i in range(N):
    B = C[:]
    B.pop(i)
    chose(B)
Problem p02682 (python)

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

sum = 0
num = 0
nm = [1,0,-1]
c = n[3]
cu =0


for i in n:
    if c == 0:
        break
    if i > c:
        sum+= nm[num]*c
        break
    if i <= c:
        sum += nm[num] * i
        c-=i
        num+=1




print(sum)

Buggy submission (verdict: Runtime Error):
n = list(map(int,input().split()))

sum = 0
num = 0
nm = [1,0,-1]
c = n[3]
cu =0


while c != 0:
    for i in n:
        if i <= c:
            sum += nm[num] * i
            c-=i
            num+=1




print(sum)
Problem p02711 (python)

Fixed submission:
n = str(input())

for i in range(len(n)):
  if n[i]=="7":
    print("Yes")
    break
  if i == len(n)-1:
    print("No")

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

for i in range(len(n)):
  if n[i]=="7":
    print("Yes")
  if i == n-1:
    print("No")
Problem p02712 (python)

Fixed submission:
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    l+=1
  else:
    li.append(l)
    l+=1

print(sum(li))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    li.append(l)
    l+=1
  else:
    li+=1

print(li)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    li.append(l)
    l+=1
  else:
    li+-1

print(li)
Problem p02623 (python)

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
book_a = [0] * (n + 1)
book_b = [0] * (m + 1)

for i in range(n):
    book_a[i+1] = book_a[i] + a[i]

for j in range(m):
    book_b[j + 1] = book_b[j] + b[j]

r = m
ans = 0

for i in range(n + 1):
    if book_a[i] > k:
        break
    while book_a[i] + book_b[r] > k:
        r -= 1
    ans = max(ans, i + r)

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

time = 0
count = 0
while len(a) > 0 or len(b) > 0:
    if len(a) ==  0:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif len(b) == 0:
        book_a = a.popleft()
        time += book_a
        count+= 1
    elif a[0] > b[0]:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif a[0] == b[0]:
        if a[1] > b[1]:
            book_b = b.popleft()
            time += book_b
            count += 1
        else:
            book_a = a.popleft()
            time += book_a
            count += 1            
    else:
        book_a = a.popleft()
        time += book_a
        count += 1
    if time > k:
        count -= 1
        break

    
print(count)

Buggy submission (verdict: Runtime Error):
from collections import deque
n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

time = 0
count = 0
while len(a) > 0 or len(b) > 0:
    if len(a) ==  0:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif len(b) == 0:
        book_a = a.popleft()
        time += book_a
        count+= 1
    elif a[0] > b[0]:
        book_b = b.popleft()
        time += book_b
        count += 1
    elif a[0] == b[0]:
        if a[1] > b[1]:
            book_b = b.popleft()
            time += book_b
            count += 1
        else:
            book_a = a.popleft()
            time += book_a
            count += 1            
    else:
        book_a = a.popleft()
        time += a.popleft()
        count += 1
    if time > k:
        count -= 1
        break

    
print(count)

Buggy submission (verdict: Runtime Error):
from collections import deque
n, m, k = map(int, input().split())
a = deque(list(map(int, input().split())))
b = deque(list(map(int, input().split())))

time = 0
count = 0
while len(a) > 0 or len(b) > 0:
    if len(a) ==  0:
        time += b.popleft()
        count += 1
    elif len(b) == 0:
        time += a.popleft()
        count+= 1
    elif a[0] > b[0]:
        time += b.popleft()
        count += 1
    elif a[0] == b[0]:
        if a[1] > b[1]:
            time += b.popleft()
        else:
            time += a.popleft()
        count += 1            
    else:
        time += a.popleft()
        count += 1
    if time > k:
        count -= 1
        break

    
print(count)
Problem p02753 (python)

Fixed submission:
s = input()
if "A" in s and "B" in s:
    print("Yes")
else:
    print("No")

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

Fixed submission:
n, a, b = map(int, input().split())
ans = n // (a + b) * a
x = n % (a + b)
ans += min(a, x)
print(ans)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = n - (a + b)
y = x % b
print(a + y)

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

Fixed submission:
s = int(input())
s_1 = s // 100 #4桁の数字列の上2桁を取り出す
s_2 = s % 100  #4桁の数字列の下2桁を取り出す

if 1 <= s_1 <=12 and 1 <= s_2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s_1 <= 12:
    print("MMYY")
elif 1 <= s_2 <= 12:
    print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
if 1 <= s_1 <=12 and 1 <= s_2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s_1 <= 12:
    print("MMYY")
elif 1 <= s_2 <= 12:
    print("YYMM")
else:
    print("NA")
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]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>k:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>k:
        break
        
ans = 0
y = len(b_sum)-1
for i in range(len(a_sum)):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(y,-1,-1):
        if time>=b_sum[j]:
            y = j
            break
    if time>=b_sum[len(b_sum)-1]:
        j = len(b_sum)-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()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>1e+9:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>1e+9:
        break
        
ans = 0
for i in range(len(b_sum)):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(len(b_sum)):
        if time<b_sum[j+1]:
            break
    if time>=b_sum[len(b_sum)-1]:
        j = len(b_sum)-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()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>1e+9:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>1e+9:
        break
        
ans = 0
for i in range(len(b_sum)):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(len(b_sum)):
        if time<b_sum[j+1]:
            break
    if time>=b_sum[len(b_sum)]:
        j = len(b_sum)
    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()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>1e+9:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>1e+9:
        break
        
ans = 0
for i in range(len(b_sum)):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(len(b_sum)):
        if time<b_sum[j+1]:
            break
    if time>=b_sum[m]:
        j = m
    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()))
a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a[i]+a_sum[i])
    if a_sum[i]>1e+9:
        break
for i in range(m):
    b_sum.append(b[i]+b_sum[i])
    if b_sum[i]>1e+9:
        break
        
ans = 0
for i in range(n+1):
    if a_sum[i]>k:
        break
    time = k - a_sum[i]
    for j in range(m):
        if time<b_sum[j+1]:
            break
    if time>=b_sum[m]:
        j = m
    ans = max(ans,i+j)
    
print(ans)
Problem p02629 (python)

Fixed submission:
n = int(input())
ans = []
keta = n//26
while n != 0:
    i = n%26
    if i == 0:
        o = 'z'
        n = n//26 -1
    else:
        o = chr(n%26 +96)
        n //= 26
    ans.append(o)
ans = reversed(ans)
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = []
while n != 0:
    o = chr(n%26 +96)
    ans.append(o)
    n //= 26
ans = reversed(ans)
print(''.join(ans))n = int(input())
ans = []
while n != 0:
    o = chr(n%26 +96)
    ans.append(o)
    n //= 26
ans = reversed(ans)
print(''.join(ans))
Problem p02682 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
for a in range(A):
    if a == K:
        print(a)
        exit()
for b in range(B):
    if a+b == K:
        print(a)
        exit()
for c in range(C):
    if a+b+c == K:
        print(a-c)
        exit()
Problem p03346 (python)

Fixed submission:
#pdf見た
n = int(input())
q = [0]*n
for i in range(n):
    p = int(input())-1
    q[p] = i
    
s=f=0
c = set()
for i in range(1,n):
    if q[i]<q[i-1]:
        f=i-1
        c.add(f-s+1)
        s=i
if c==set():
    print(0)
else:
    print(n-max(c))

Buggy submission (verdict: Runtime Error):
#pdf見た
n = int(input())
q = [0]*n
for i in range(n):
    p = int(input())-1
    q[p] = i
    
s=f=0
c = set()
for i in range(2,n):
    if q[i]<q[i-1]:
        f=i-1
        c.add(f-s+1)
        s=i
print(n-max(c))
Problem p02571 (python)

Fixed submission:

s=input()
t=input()
ans=10000
lt=len(t)
ls=(len(s))
start,last=0,lt
while last<=ls:
    count=0
    j=0
    for i in range (start,last):
        if s[i]!=t[j]:
            count+=1
        j+=1
    ans=min(ans,count)
    start+=1
    last+=1


print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
index=0
count=0
for i in range (len(s)):
    if s[i]==t[0]:
       index=i+1
       break
if index == 0:
    for j in range(len(t)):
        if t[j]!=s[j]:
            count+=1
    
else:
    
    for j in range (1,len(t)):
        if t[j]!= s[index]:
            count+=1
        index+=1
print(count)
Problem p02547 (python)

Fixed submission:
n = int(input()) 
temp = 0
for i in range(n):
  d,w = map(int,input().split())
  if d==w:
    temp += 1 
    if temp == 3 :
      print("Yes")
      exit()
  else:
    temp = 0 
    
print("No")

Buggy submission (verdict: Runtime Error):
n = input() 
temp = 0
for i in range(n):
  d,w = map(int,input().split())
  if d==w:
    temp += 1 
    if temp == 3 :
      print("Yes")
      exit()
  else:
    temp = 0 
    
print("No")
Problem p02578 (python)

Fixed submission:

n = int(input())
A = list(map(int,input().split()))
ans = 0 
temp = 0
for i in range(n):
    if A[i]<temp:
        ans += temp-A[i]
    else:
        temp = max(temp,A[i])

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
A = list(map(int,input().split()))
ans = 0 
temp = 0
for i in range(n):
    if A[i]<temp:
        ans += temp-A[i]
    else:
        temp = max(temp,A[i])

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
A = list(map(int,input().split()))
ans = 0 
temp = 0
for i in range(n-1):
    if A[i]<temp:
        ans += temp-A[i]
    else:
        temp = max(temp,A[i])

print(ans)
Problem p02659 (python)

Fixed submission:
import math
S=list(map(str, input().split()))
a=S[0]
b=S[1]
c=b[0]+b[2]+b[3]
print(math.floor(int(a)*(int(c))//100))

Buggy submission (verdict: Runtime Error):
S=list(map(str, input().split()))
a=S[0]
b=S[1]
print(math.floor(int(a)*float(b)))
Problem p02759 (python)

Fixed submission:
a=int(input())
print((a+1)//2)

Buggy submission (verdict: Runtime Error):
s=input()
a=int(s)
d=a/2
e=(a+1)/2

if a%=2:
    print(d)
else :
    print(e)
Problem p02779 (python)

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

if len(b) != len(set(b)):
    print('NO')
else:
    print('YES')

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

if len(seq) != len(set(seq)):
    print('NO')
else:
    print('YES')
Problem p02781 (python)

Fixed submission:
n=input()
k=int(input())
m=len(n)
dp=[[[0]*(k+1) for _ in range(2)] for _ in range(m+1)]
dp[0][0][0]=1
for i in range(1,m+1):
    l = int(n[i-1])
    for j in range(k+1):
        dp[i][1][j]+=dp[i-1][1][j] 
        if l!=0:
            dp[i][1][j]+=dp[i-1][0][j]  
        else:
            dp[i][0][j]+=dp[i-1][0][j]      
        if j-1>=0:
            dp[i][1][j]+=9*dp[i-1][1][j-1]
            if l!=0:
                dp[i][0][j]+=dp[i-1][0][j-1]
                dp[i][1][j]+=(l-1)*dp[i-1][0][j-1]
print(dp[m][0][k]+dp[m][1][k])

Buggy submission (verdict: Runtime Error):
n=input()
k=input()
sum=0
for i in range(1,k+1):
    a=list(str(i))
    if list.count(0)=k:
        sum+=1
print(sum)