Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

L = len(make_divisors(N))

ans = 0
for i in range(1,L):
    t = N
    while t%(make_divisors(N)[i]) == 0:
        t = t//make_divisors(N)[i]
    if t%make_divisors(N)[i] == 1:
        ans = ans + 1
        
print(ans + len(make_divisors(N-1)) -1)

Fixed submission:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

L = len(make_divisors(N))

A = make_divisors(N)

ans = 0
for i in range(1,L):
    t = N
    while t%(A[i]) == 0:
        t = t//A[i]
    if t%A[i] == 1:
        ans = ans + 1
        
print(ans + len(make_divisors(N-1)) -1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

L = len(make_divisors(N))

ans = 0
for i in range(L):
    t = N
    while t%(make_divisors(N)[i]) == 0:
        t = t//make_divisors(N)[i]
    if t%(make_divisors(N)[i]) == 1:
        ans = ans + 1
        
print(ans + len(make_divisors(N-1)) -1)

Fixed submission:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

L = len(make_divisors(N))

A = make_divisors(N)

ans = 0
for i in range(1,L):
    t = N
    while t%(A[i]) == 0:
        t = t//A[i]
    if t%A[i] == 1:
        ans = ans + 1
        
print(ans + len(make_divisors(N-1)) -1)
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())

t=1000000007

def mod(k):
    return k%t

def comb(n,k,p):
  from math import factorial
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=factorial(n) %p
  b=factorial(k) %p
  c=factorial(n-k) %p
  return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,b,p):
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p

base=power_func(2,n,t)
    
print(mod(2*t+base-1-comb(n,a,t)-comb(n,b,t)))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
sum=0
for i in range(N):
    sum = sum+A[i]
ans = 0
if sum%N <= N//2:
    for i in range(N):
        ans = ans+ (A[i]-(sum//N))**2
    print(ans)
else:
    for i in range(N):
        ans = ans+ (A[i]-1-(sum//N))**2
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))

maxi = A[0]
for  i in range(N):
    if A[i] >= maxi:
        maxi = A[i]
    else:
        maxi = maxi
        
count = 0
position = 0
while position < N:
  for j in range(1,maxi+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1
 
if count != 0:
    print(N-count)
else:
    print(-1)

Fixed submission:
a,b=map(int,input().split())
gcm=1
for i in range(1,1+min(a,b)):
  if a%i == 0 and b%i == 0:
    gcm = i
  else:
    gcm = gcm
    
print((a*b)//gcm)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
max = A[0]
for  i in range(N):
    if A[i] >= max:
        max = A[i]
    else:
        max = max
        
count = 0
position = 0
while position < N:
  for j in range(1,max):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1

if count != 0:
    print(N-count)
else:
    print(-1)

Fixed submission:
a,b=map(int,input().split())
gcm=1
for i in range(1,1+min(a,b)):
  if a%i == 0 and b%i == 0:
    gcm = i
  else:
    gcm = gcm
    
print((a*b)//gcm)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
count = 0
position = 0
while position < N:
  for j in range(1,N+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1

if count != 0:
    print(N-count)
else:
    print(-1)


Fixed submission:
a,b=map(int,input().split())
gcm=1
for i in range(1,1+min(a,b)):
  if a%i == 0 and b%i == 0:
    gcm = i
  else:
    gcm = gcm
    
print((a*b)//gcm)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
 
maxi = A[0]
for  i in range(N):
    if A[i] >= maxi:
        maxi = A[i]
    else:
        maxi = maxi
        
count = 0
position = 0
while position < N:
  for j in range(1,maxi+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1
 
if count != 0:
    print(N-count)
else:
    print(-1)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count = 0
position = 0
while position < N:
  for j in range(1,N+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        position += 1
        break
      else:
        position = position + 1

if count != 0:
    print(N-count)
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
count = 0
position = 0
while position < N:
  for j in range(1,N+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        break
      else:
        position = position + 1

if count != 0:
    print(N-count)
else:
    print(-1)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count = 0
position = 0
while position < N:
  for j in range(1,N+1):
    for i in range(position,N):
      if A[i] == j:
        count = count + 1
        position += 1
        break
      else:
        position = position + 1

if count != 0:
    print(N-count)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
count = 0
for i in range(1000):
    x= i%10
    z= i//100
    y= (i-x-(z*100))//10
    
    p=0
    for j in range(N):
        if S[j]!=str(z):
            p = p+1
        else:
          for k in range(p+1,N):
            if S[k]!=str(y):
                p = p+1
            else:
                for l in range(q+1,N):
                  if S[l]!=str(x):
                    p = p+1
                  else:
                    break
                
                
    if p<=N-2:
      count = count+1
    else:
      count = count
      
print(count)

Fixed submission:
X=int(input())
if X//100 != X//105:
  print(1)
elif X//100 == X//105 and X%105==0:
  print(1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
count = 0
for i in range(1000):
    x= i%10
    z= i//100
    y= (i-x-(z*100))//10
    
    p=0
    for j in range(N):
        if S[j]!=str(z):
            p = p+1
        else:
          for k in range(p+1,N):
            if S[k]!=str(y):
                p = p+1
            else:
                for l in range(q+1,N):
                  if S[l]!=str(x):
                    p = p+1
                  else:
                    break
                
                
    if p<=N-2:
      count = count+1
    else:
      count = count

Fixed submission:
X=int(input())
if X//100 != X//105:
  print(1)
elif X//100 == X//105 and X%105==0:
  print(1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
count = 0
for i in range(1000):
    x= i%10
    z= i//100
    y= (i-x-(z*100))//10
    
    p=0
    for j in range(N):
        if S[j]!=str(z):
            p = p+1
        else:
            break
    if p==N:
        count = count
        break
    else:
        q=p+1
        for k in range(p+1,N):
            if S[k]!=str(y):
                q = q+1
            else:
                break
        if q == N:
            count = count
            break
        else:
            r=q+1
            for l in range(q+1,N):
                if S[l]!=str(x):
                    r = r+1
                else:
                    break
            if r == N:
                count = count
            else:
                count = count+1
 
print(count)

Fixed submission:
X=int(input())
if X//100 != X//105:
  print(1)
elif X//100 == X//105 and X%105==0:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
p=1+N
for i in range(1,N):
    if N%i==0:
        if (N/i)+i<=p:
            p=(N//i)+i
        else:
            p=p
    else:
        pass

print(p-2)

Fixed submission:
N=int(input())
p=0
for i in range(1,N):
  if i**2<=N:
    p=p+1
  else:
    break
    
q=p   
for i in reversed(range(p+1)):
  if N%i!=0:
    q=q-1
  else:
    break
    
print((q+(N//q))-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
p=0
for i in range(1,N):
  if i**2<=N:
    p=p+1
  else:
    break
    
q=p   
for i in range(p,N):
  if N%i!=0:
    q=q+1
  else:
    break
    
print((q+(N//q))-2)

Fixed submission:
N=int(input())
p=0
for i in range(1,N):
  if i**2<=N:
    p=p+1
  else:
    break
    
q=p   
for i in reversed(range(p+1)):
  if N%i!=0:
    q=q-1
  else:
    break
    
print((q+(N//q))-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
p=0
for i in range(1,N):
  if i**2<=N:
    p=p+1
  else:
    break
    
q=p   
for i in range(p,N):
  if N%i!=0:
    q=q+1
  else:
    break
    
print((q+(N//q))-2)

Fixed submission:
N=int(input())
p=0
for i in range(1,N):
  if i**2<=N:
    p=p+1
  else:
    break
    
q=p   
for i in reversed(range(p+1)):
  if N%i!=0:
    q=q-1
  else:
    break
    
print((q+(N//q))-2)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
def water(a,b,x):
  import math
  if math.tan(math.radians(x))<=b/a:
    return (((a**2)*math.tan(math.radians(x))))/2+a*(b-a*math.tan(math.radians(x)))
  else:
    return b**2/(2*math.tan(math.radians(x)))

p=0
q=90
r=0
while r<=1000000:
  if water(a,b,(p+q)/2)<=x/a:
    p=p
    q=(p+q)/2
    r=r+1
  else:
    p=(p+q)/2
    q=q
    r=r+1

print((p+q)/2)

Fixed submission:
a,b,x=map(int,input().split())
def water(a,b,x):
  import math
  if math.tan(math.radians(x))<=b/a:
    return (((a**2)*math.tan(math.radians(x))))/2+a*(b-a*math.tan(math.radians(x)))
  else:
    return b**2/(2*math.tan(math.radians(x)))

p=0
q=90
r=0
while r<=1000:
  if water(a,b,(p+q)/2)<=x/a:
    p=p
    q=(p+q)/2
    r=r+1
  else:
    p=(p+q)/2
    q=q
    r=r+1

print((p+q)/2)
Buggy python submission (verdict: Runtime Error):
S=input()
x=0
for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

Fixed submission:
S=input()
x=0
if len(S)%2==1:
 for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x
else:
 for i in range(len(S)//2):
  if S[2*i]=='L':
    x= x+1
  else:
    x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
S=input()
x=0
for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

Fixed submission:
S=input()
x=0
if len(S)%2==1:
 for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x
else:
 for i in range(len(S)//2):
  if S[2*i]=='L':
    x= x+1
  else:
    x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')
Buggy python 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()))
x=0
for i in range (N-2):
  if A[i]+1 == A[i+1]:
    x= x+B[i]+C[A[i]]
  else:
    x= x+B[i]
print(x+B[N-1])

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=0
for i in range (N-1):
  if A[i]+1 == A[i+1]:
    x= x+B[i]+C[A[i]-1]
  else:
    x= x+B[i]
print(x+B[N-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
List.sort()
a= List[0]
for i in range(len(List)):
  a= (a+List[i])/2
print(a)

Fixed submission:
a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')

Buggy python submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
a=0
List.sort()
for i in range(len(List)):
  a= (a+List[i])/2
print(a)

Fixed submission:
a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
      a= a+(1/(List[i])
print (1/a)

Fixed submission:
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
   a+= 1/(List[i])
print(1/a)

Buggy python submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
   a= a+(1/(List[i])
print (1/a)

Fixed submission:
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
   a+= 1/(List[i])
print(1/a)

Buggy python submission (verdict: Runtime Error):
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
   a= a+(1/i)
print (1/a)

Fixed submission:
N=int(input())
List=list(map(int,input().split()))
a=0
for i in range (len(List)):
   a+= 1/(List[i])
print(1/a)
Buggy python submission (verdict: Runtime Error):
K,X=map(int,input().split())
for i in range (X-K+1,X+K-1)
    print(i)

Fixed submission:
K,X=map(int,input().split())
for i in range (X-K+1,X+K):
    print(i)
Buggy python submission (verdict: Runtime Error):
N=int(input())
import math
if 0<=math.log10(N)<1:
  print(N)
elif 1<=math.log10(N)<2:
  print(9)
elif 2<=math.log10(N)<3:
  print(N-90)
elif 3<=math.log10(N)<4:
  print(909)
elif 4<=math.log10(N)<5:
  print(N-9090)
elif:
  print(90909)

Fixed submission:
N=int(input())
import math
if 0<=math.log10(N)<1:
  print(N)
elif 1<=math.log10(N)<2:
  print(9)
elif 2<=math.log10(N)<3:
  print(N-90)
elif 3<=math.log10(N)<4:
  print(909)
elif 4<=math.log10(N)<5:
  print(N-9090)
elif 5<=math.log10(N):
  print(90909)
Buggy python submission (verdict: Runtime Error):
N,D=map(int,input().split())
a=0
while a*((2*D)+1)<N:
    a=a+1
print(a)

Fixed submission:
r=int(input())
print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
N,A,B=input().split(",")
if (N*A) > B
  print (B)
else:
  print(N*A)


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

Buggy python submission (verdict: Runtime Error):
N= int(input())
A= int(input())
B= int(input())

if N*A>B:
  print (B)
else: 
  print (N*A)

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

Buggy python submission (verdict: Runtime Error):
N= int(input())
A= int(input())
B= int(input())
C= N*A
if C>B:
  print (B)
else: 
  print (C)

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

Buggy python submission (verdict: Runtime Error):
N= int(input('N='))
A= int(input('A='))
B= int(input('B='))
C= N*A
if C>B:
  print (B)
else: 
  print (C)

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

Buggy python submission (verdict: Runtime Error):
N= int(input)
A= int(input)
B= int(input)
C= N*A
if C>B:
  print (B)
else: 
  print (C)

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

Buggy python submission (verdict: Runtime Error):
N= int(input)
A= int(input)
B= int(input)
if A*N>B:
  print(B)
else: 
  print(A*N)

Fixed submission:
N,A,B=map(int,input().split())
if N*A >=B:
  print (B)
else:
  print(N*A)
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int, input().split())
print(W*H/2)
if W==2*x  and H=2*y:
  print(1)
else:
  print(0)

Fixed submission:
W,H,x,y = map(int, input().split())
print(W*H/2)
if W==2*x  and H==2*y:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N=int(input())
h=list(map(int,input().split()))
p=h[0]
for i in range(N-1):
  if h[i]<h[i+1]:
    p=h[i+1]
  else:
    p=p

q=1
r=0
if p==0:
    print(0)
else:
   while q<=p:
        if h[0]>=q:
            r=r+1
        else:
            r=r
        for i in range(N-1):
              if h[i]<q and h[i+1]>=q:
                r=r+1
              else:
                r=r
    q=q+1

print(r)

Fixed submission:
N=int(input())
h=list(map(int,input().split()))
p=h[0]
for i in range(N-1):
  if p<h[i+1]:
    p=h[i+1]
  else:
    p=p
 
q=1
r=0
if p==0:
    print(0)
else:
    while q<=p:
        if h[0]>=q:
            r=r+1
        else:
            r=r
        for i in range(N-1):
              if h[i]<q and h[i+1]>=q:
                r=r+1
              else:
                r=r
        q=q+1
    print(r)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
A = [list(map(int,input().split())) for i in range(N)]

def bubble_sort(arr):
    change = True
    while change:
        change = False
        for i in range(len(arr) - 1):
            if arr[i] > arr[i + 1]:
                arr[i], arr[i + 1] = arr[i + 1], arr[i]
                change = True
    return arr

B=[]
for i in range(N):
    B.append(A[i][0])
    
C=bubble_sort(B)

ans = C[K-1] - C[0]
for i in range(N-K+1):
    if ans > C[i+K-1] -C[i]:
        ans = C[i+K-1] -C[i]
        
print(ans)

Fixed submission:

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
Buggy python submission (verdict: Runtime Error):
if(int(input())==1):
    print("Hello World")
else:
    a,b=map(int,input().split())
    print(a+b)

Fixed submission:
if(int(input())==1):
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:
    print("Hello World")
elif n==2:
    a,b=map(int,input().split())
    print(a+b)

Fixed submission:
if(int(input())==1):
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
import sys
n,m=map(long,input().split())
if n==1:
    print(m)
    sys.exit()
ans=[]
i=1
while i<=m/i:
    if m%i:
        i=i+1
    else:
        j=m/i
        if j>=n:
            ans.append(i)
        if i>=n:
            ans.append(j)
        i=i+1
ans.sort()
print(ans[len(ans)-1])

Fixed submission:
import sys
n,m=map(int,input().split())
if n==1:
    print(m)
    sys.exit()
ans=[]
i=int(1)
while i<=m/i:
    if m%i!=0:
        i+=1
    elif m%i==0:
        j=int(m/i)
        if j>=n:
            ans.append(i)
        if i>=n:
            ans.append(j)
        i+=1
ans.sort()
print(ans[len(ans)-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list(int(x) for x in input().split())
delete_list = list()
d_append = delete_list.append

for i in range(M):
    A,B = map(int, input().split())
    if(Hlist[A-1] == Hlist[B-1]) :
        d_append(A-1)
        d_append(B-1)
    elif(Hlist[A-1] > Hlist[B-1]) :
        d_append(B-1)
    else :
        d_append(A-1)

delete_list = list(set(delete_list))#重複を消す
ans_list = Hlist.copy()
for d in delete_list:
    ans_list.remove(Hlist[d])

print(len(ans_list))

Fixed submission:
import sys
input = sys.stdin.readline
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list(int(x) for x in input().split())

flag = [1]*N

for i in range(M):
    A,B = map(int, input().split())
    A -= 1
    B -= 1
    if(Hlist[A] == Hlist[B]) :
        flag[A] = 0
        flag[B] = 0
    elif(Hlist[A] > Hlist[B]) :
        flag[B] = 0
    else :
        flag[A] = 0
print(sum(flag))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list((int(x) for x in input().split()))
delete_list = list()
for i in range(M):
    A,B = map(int, input().split())
    if(Hlist[A-1] == Hlist[B-1]) :
        delete_list.append(A-1)
        delete_list.append(B-1)
    elif(Hlist[A-1] > Hlist[B-1]) :
        delete_list.append(B-1)
    else :
        delete_list.append(A-1)

delete_list = list(set(delete_list))#重複を消す
ans_list = Hlist.copy()
for d in delete_list:
    ans_list.remove(Hlist[d])

print(len(ans_list))

Fixed submission:
import sys
input = sys.stdin.readline
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list(int(x) for x in input().split())

flag = [1]*N

for i in range(M):
    A,B = map(int, input().split())
    A -= 1
    B -= 1
    if(Hlist[A] == Hlist[B]) :
        flag[A] = 0
        flag[B] = 0
    elif(Hlist[A] > Hlist[B]) :
        flag[B] = 0
    else :
        flag[A] = 0
print(sum(flag))
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()

t_l = len(t)
diff_min = 999999999

def diff_str(s1, s2):
    diff_c = 0
    for j in range(len(seq)):
        if s1[j] != s2[j]:
            diff_c += 1
    return diff_c

if len(s) == len(t):
    diff_min = diff_str(s, t)

for i in range(len(s)-t_l):
    seq=s[i:i+t_l]
    diff_c = diff_str(seq, t)
    if diff_c < diff_min:
        diff_min = diff_c


print(diff_min)





Fixed submission:
s=input()
t=input()

t_l = len(t)
diff_min = 999999999

def diff_str(s1, s2):
    diff_c = 0
    for j in range(len(s1)):
        if s1[j] != s2[j]:
            diff_c += 1
    return diff_c

if len(s) == len(t):
    diff_min = diff_str(s, t)

for i in range(len(s)-t_l):
    seq=s[i:i+t_l]
    diff_c = diff_str(seq, t)
    if diff_c < diff_min:
        diff_min = diff_c


print(diff_min)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
		
def gcd_t(a,b,c):
	return gcd(gcd(a, b), c)
	
K = int(input())
result = 0
for i in range(1, K + 1):
	for j in range(1, K + 1):
		for k in range(1, K + 1):
			result += gcd_t(i, j, k)

print(result)

Fixed submission:

from math import gcd

K = int(input())
result = 0
for i in range(1, K + 1):
	for j in range(1, K + 1):
		for k in range(1, K + 1):
			result += gcd(gcd(i, j), k)

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
		
def gcd_t(a,b,c):
	return gcd(gcd(a, b), c)
	
K = int(input())
result = 0
for i in range(1, K + 1):
	for j in range(1, K + 1):
		for k in range(1, K + 1):
			result += gcd_t(i, j, k)

print(result)

Fixed submission:

from math import gcd

K = int(input())
result = 0
for i in range(1, K + 1):
	for j in range(1, K + 1):
		for k in range(1, K + 1):
			result += gcd(gcd(i, j), k)

print(result)