Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = []
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
p = 0
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
N ,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().strip().split()))
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)

Buggy python submission (verdict: Runtime Error):
N ,K = int(input().strip().split())
a = list(map(int, input().strip().split()))
for i range (N):
  if a[i] >= K:
    p += 1
print(p)

Fixed submission:
N,K = input().strip().split()
N = int(N)
K = int(K)
a = list(map(int, input().split()))
p = 0
for i in range(N):
  if a[i] >= K:
    p += 1
print(p)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
x = a + b
y = a - b
z = a * b
i[1] = x
i[2] = y
i[3] = z
i.sort
print(i[2])

Fixed submission:
a,b = map(int, input().split())
x = a + b
y = a - b
z = a * b
i = []
i.append(x)
i.append(y)
i.append(z)
i.sort()
print(i[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A:
  print(Yes)
else:
  print(No)

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print(Yes);  
else:
  print(No);

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A:
   print(Yes)
else:
   print(No)

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
C = 0
C = N % 500
if C <= A;
   print(Yes)
else;
   print(No)

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()
C = 0
C = N % 500
if C <= A;
   print(Yes)
else;
   print(No)

Fixed submission:
N = int(input());
A = int(input());
C = 0;
C = N % 500;
if C <= A:
  print("Yes");  
else:
  print("No");
Buggy python submission (verdict: Runtime Error):
K X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
K=int(input())
X=int(input())

if 500*K < X:
	print("No")
else:
  print("Yes")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
if 500*K < X:
	print("No")
else:
  print("Yes")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
if 500*K < X :
	print("No")
else :
  print("Yes")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
if 500*K < X :
	print("Yes")
else :
  print("No")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
if 500*K < X 
	print("Yes")
else print("No")

Fixed submission:
K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

Fixed submission:
s= input()
a = 0
for i in range(len(s)):
    if i%2:
        if s[i]=="R":
            a = 1
            break
    else:
        if s[i]=="L":
            a = 1
            break
if a == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()

Fixed submission:
s= input()
a = 0
for i in range(len(s)):
    if i%2:
        if s[i]=="R":
            a = 1
            break
    else:
        if s[i]=="L":
            a = 1
            break
if a == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int,input().split())
ans = int(0)
for i in range(max(A,B)):
    if abs(A-i) == abs(B-i):
        ans = i
if (ans == 0):
    print("IMPOSSIBLE")
else:
    print(ans)

Fixed submission:
A,B = map(int,input().split())
k = (A+B)
if k%2 == 0:
    print(int(k/2))
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int,input().split())
ans = int(0)
for i in range(max(A,B)):
    if (A-i)**2 == (B-i)**2:
        ans = i
if (ans == 0):
    print("IMPOSSIBLE")
else:
    print(ans)

Fixed submission:
A,B = map(int,input().split())
k = (A+B)
if k%2 == 0:
    print(int(k/2))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N > M:
    ans = 0
else:
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)

Fixed submission:
T,x = map(int, input().split())
#print(T,x)
t = T/x
print(round(t,10))
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N>M:
    ans = 0
else
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)

Fixed submission:
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N > M:
    ans = 0
else:
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M,X = map(int,input().split())
print(N)
num = list(map(int, input().split()))
print(str_)
s = [i for i in num if i > X]
p = len(s)
q = M-p
if p >q:
    print(q)
else:
    print(p)

Fixed submission:
N,M,X = map(int,input().split())
#print(N)
num = list(map(int, input().split()))
#print(str_)
s = [i for i in num if i > X]
p = len(s)
q = M-p
if p >q:
    print(q)
else:
    print(p)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
readline = sys.stdin.readline
write = sys.stdout.write

def main():
  N = int(readline())
  a = np.array(list(map(int, readline().split())))
  b = np.array(list(map(int, readline().split())))
  NA = np.arange(N)

  #for k in range(N):
  #  pass
    #r = np.bitwise_xor(a[(NA+k)%N], b)
    #if np.all(r == r[0]):
    #  pass
    #  #print(k, r[0])

if __name__ == '__main__':
    main()
 

Fixed submission:
K, X = map(int, input().split())

if K * 500 >= X:
  print('Yes')
else:
  print('No')

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

def main():
  N = int(readline())
  a = list(map(int, readline().split()))
  b = list(map(int, readline().split()))
  buf = []
  
  for k in range(N):
    c = []
    last = None
    for i in range(N):
      r = c.append(a[(i+k)%N] ^ b[i])
      if last != r:
      	break
      last = r
    else:
      buf.append((k, c[0]))
  for d in buf:
    print(d[0], d[1])

if __name__ == '__main__':
    main()
 

Fixed submission:
K, X = map(int, input().split())

if K * 500 >= X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
cnt = int(input())
str = input()
print(srt.count('ABC'))

Fixed submission:
cnt = int(input())
s = input()
print(s.count('ABC'))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())

i, j = 1, 1
footsteps = []
while i * j != N:
    footsteps.append((i, j))
    left = (i - 1) * j
    up = i * (j - 1)
    right = (i + 1) * j
    down = i * (j + 1)
    distances = {
            (i - 1, j): abs(N - left),
            (i, j - 1): abs(N - up),
            (i + 1, j): abs(N - right),
            (i, j + 1): abs(N - down),
            }
    items = distances.items()
    items = filter(lambda (k, v): k not in footsteps, items)
    i, j = min(items, key=lambda (k, v): v)[0]
print i - 1 + j - 1


Fixed submission:
import math

N = int(raw_input())

limit = int(math.sqrt(N)) + 1
n = float(N)
minimum = (1, 1, N)
for i in range(1, limit):
    j = n / i
    if not j.is_integer():
        continue
    j = int(j)
    distance = i + j - 2
    if minimum[2] > distance:
        minimum = i, j, distance
print(minimum[2])
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left

N = int(raw_input())
L = map(int, raw_input().split())

L.sort()
result = 0
for i, a in enumerate(L, 1):
    for j, b in enumerate (L[i:], i+1):
        k = bisect_left(L[j:], a + b)
        result += k
print result


Fixed submission:
from bisect import bisect_left

N = int(raw_input())
L = map(int, raw_input().split())

L.sort()
result = 0
for i in xrange(N-2):
    a = L[i]
    for j in xrange(i+1, N-1):
        b = L[j]
        k = bisect_left(L, a + b, j + 1)
        result += k - (j + 1)
print result

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(raw_input())
L = map(int, raw_input().split())


def number_of_triangles():
    if N < 3:
        return 0
    return sum(1 for a, b, c in combinations(L, 3) if a < b + c and b < c + a and c < a + b)

print number_of_triangles()


Fixed submission:
from bisect import bisect_left

N = int(raw_input())
L = map(int, raw_input().split())

L.sort()
result = 0
for i in xrange(N-2):
    a = L[i]
    for j in xrange(i+1, N-1):
        b = L[j]
        k = bisect_left(L, a + b, j + 1)
        result += k - (j + 1)
print result

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(raw_input())
L = map(int, raw_input().split())


def number_of_triangles():
    if N < 3:
        return 0
    result = 0
    for a, b, c in combinations(L, 3):
        if a < b + c and b < c + a and c < a + b:
            result += 1
    return result

print number_of_triangles()


Fixed submission:
from bisect import bisect_left

N = int(raw_input())
L = map(int, raw_input().split())

L.sort()
result = 0
for i in xrange(N-2):
    a = L[i]
    for j in xrange(i+1, N-1):
        b = L[j]
        k = bisect_left(L, a + b, j + 1)
        result += k - (j + 1)
print result
Buggy python submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    stripped = s.lstrip(s[0])
    if len(stripped):
        return count_least_turns(stripped, n + 1)
    return n

print count_least_turns(S)


Fixed submission:
S = raw_input()

s = S
n = 0
while len(s):
    s = s.lstrip(s[0])
    if len(s):
        n += 1

print n

Buggy python submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    stripped = s.lstrip(s[0])
    if len(stripped) <= 1:
        return n
    return count_least_turns(stripped, n + 1)

print count_least_turns(S)


Fixed submission:
S = raw_input()

s = S
n = 0
while len(s):
    s = s.lstrip(s[0])
    if len(s):
        n += 1

print n

Buggy python submission (verdict: Runtime Error):
S = raw_input()

def count_least_turns(s, n=0):
    print s
    stripped = s.lstrip(s[0])
    if len(stripped) <= 1:
        return n
    return count_least_turns(stripped, n + 1)

print count_least_turns(S)


Fixed submission:
S = raw_input()

s = S
n = 0
while len(s):
    s = s.lstrip(s[0])
    if len(s):
        n += 1

print n
Buggy python submission (verdict: Runtime Error):
K, X = map(int(input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")

Fixed submission:
K, X = map(int, input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
K, X = input(), input()

if 500*K >= X:
  print("Yes")
else:
  print("No")

Fixed submission:
K, X = map(int, input().split())

if 500*K >= X:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
#coding: utf-8;
import itertools
import math

def hoge(i,flag):
  s = list(flag)
  s[i] = "B"
  return "".join(s)

N = int(input())
data = input()

R=[]
G=[]
B=[]
count = 0

for i,c in enumerate(data):
  if c=="R":
    R.append(i)
    continue
  if c=="G":
    G.append(i)
    continue
  if c=="B":
    B.append(i)
    continue

temp_max = 999999999999
min_list = []
#全探索(N!^2)でやってみようか
for num,x in enumerate(itertools.permutations(G)):
  for y in itertools.permutations(B):
      for i in range(N):
        ti = R[i]+G[i]+B[i]
        if ti==temp_max:
          min_list.append(R[i]+G[i]+B[i])
        elif ti<temp_max:
          temp_max = ti
          min_list = [R[i]+G[i]+B[i]]

print((len(min_list)*math.factorial(N))%998244353)

##TLE -> temp_maxより大きいのは登録しないようにしようか

Fixed submission:
#coding: utf-8;

data = input()
#\nは？

K = 0
count = 0
prev = ""
now = ""
i = 0

if len(data)==1:
  print("1")
  exit()

while True:
  if count==len(data):
    if len(now)==0:
      break
    if now!=prev:
      K+=1
      break
    #こっからが問題
    break

  now += data[count]
  count += 1
  if now != prev:
    prev = now
    now = ""
    K += 1

print(K)
Buggy python submission (verdict: Runtime Error):
X,Y = input().split()
X,Y = int(X),int(Y)

def d(r,n,p):#r^n mod p
    if(n==0):
        return 1
    
    elif(n%2==0):
        d_ = d(r,n//2,p)
        return (d_**2)%p
    
    else:
        d_ = d(r,(n-1),p)
        return (d_*r)%p
    
def fac(n,p):#n! mod p
    mul = 1
    for i in range(1,n+1):
        mul = (mul*i)%p
        
def r_fact_p(r,p):#(r!)^(p-2)
    mul = 1
    for i in range(1,r+1): #i^(p-2)
        mul = (mul*d(i,p-2,p))%p
        
    return mul

def C(n,r):
    return (d(r,n,p)*r_fact_p(r,p))%p



if((X-2*Y)%3 !=0 or (2*X-Y)%3 != 0):
    print(0)
    
else:
    a = (-X+2*Y)//3
    b = (2*X-Y)//3
    
    if(a<0 or b<0):
        print(0)
    else:
        
    print(C(a+b,b))

Fixed submission:
p = 10 ** 9 + 7
 
def mod_inverse(a, p):
    mod = 1
    p_bin = bin(p-2)
    for i in range(len(p_bin) - 1, 1, -1):
        if i == len(p_bin) - 1:
            mul = a
            mul %= p
            mod *= (mul ** int(p_bin[i]))
            mod %= p
        else:
            mul = mul ** 2
            mul %= p
            mod *= (mul ** int(p_bin[i]))
            mod %= p
    return mod
 
def combination(n, k, p):
    a = 1
    for i in range(n, n - k, -1):
        a *= i
        a %= p
    b = 1
    for i in range(k):
        b *= (i + 1)
        b %= p
    return (a * mod_inverse(b, p)) % p

X,Y = input().split()
X,Y = int(X),int(Y)

if((X-2*Y)%3 !=0 or (2*X-Y)%3 != 0):
    print(0)
    
else:
    a = (-X+2*Y)//3
    b = (2*X-Y)//3
    if(a<0 or b<0):
        print(0)
    else:
        
        print(combination(a+b,b,p))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
D = input().split()
D = [int(d) for d in D]
if(D[0] != 0):
    print(0)
else:
    D = sorted(D[1:])
    if(D[-1]==1):
        print(1)
    else:
        n = 0
        k = 0
        mul = 1
        k_count_before = 1
        while(n<len(D)):
            k += 1
            k_count = 0
            
            while(n<len(D) and D[n]==k):
                k_count += 1
                n += 1

            if(k_count==0):
                mul = 0
            else:

                mul *= k_count_before**k_count
                k_count_before = k_count

        print(mul%998244353)

Fixed submission:
N = int(input())
D = input().split()
D = [int(d) for d in D]

hantei = 1
if(D[0] != 0):
    print(0)
else:
    D = sorted(D[1:])
    if(D[-1]==1):
        print(1)
    else:
        n = 0
        k = 0
        mul = 1
        k_count_before = 1
        while(n<len(D)):
            k += 1
            k_count = 0
            
            while(n<len(D) and D[n]==k):
                k_count += 1
                n += 1

            if(k_count==0):
                mul = 0
                hantei = 0
                break
            else:

                mul *= k_count_before**k_count
                k_count_before = k_count

        print(mul%998244353)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x = input().split()
a,b,x = int(a),int(b),int(x)


if(x<=(a*a*b)/2):
    S = x/a
    h = (2*S/b)
    print(90.-math.atan(h/b)/(2.*math.pi)*360)
else:
    x /= a
    d = 2*x/a-b
    print(90.-math.atan(a/(b-d))*360/(2*math.pi))

Fixed submission:
import math
a,b,x = input().split()
a,b,x = int(a),int(b),int(x)


if(x<=(a*a*b)/2):
    S = x/a
    h = (2*S/b)
    print(90.-math.atan(h/b)/(2.*math.pi)*360)
else:
    #a,x = math.sqrt(a),math.sqrt(x)
    x /= a
    d = 2*x/a-b
    if(b==d):
        print(0)
    else:
        print(90.-math.atan(a/(b-d))*360/(2*math.pi))
Buggy python submission (verdict: Runtime Error):
N = input().split()
ns = input().split()

sum_ = 0
for i in range(N):
  	for j in range(N):
  		sum_ += ns[i]*ns[j]
print(sum_)

Fixed submission:
N = int(input())
ns = input().split()

sum_ = 0

for i in range(N):
    for j in range(N):
        if(i>j):
            sum_ += int(ns[i])*int(ns[j])
        
print(sum_)
Buggy python submission (verdict: Runtime Error):
N,M = input().split()
N,M = int(N),int(M)
a = [0 for i in range(M)]
b = [[] for i in range(M)]

for k in range(M):
    a[k],b_ = input().split()
    a[k],b_ = int(a[k]),int(b_)
    
    b[k] = input().split()
    b[k] = [int(j)-1 for j in b[k]] 
#print(b)
def box(i,bo):#i :i番目の鍵 b空いている宝箱
    #if(0 not in bo):
        #i=M
        #return 0
    #elif(i==M and 0 in bo):
        #return 1e+20
    
    if(i==M):
        if(0 in bo):
            return 1e+20
        else:
            return 0
    else:
        if(0 not in bo):
            return 0
    
        else:
        
            p1 = box(i+1,bo)

            new_bo = bo.copy()
            for k in range(len(b[i])):
                new_bo[b[i][k]] += 1

            p2 = box(i+1,new_bo)+a[i]
            return min([p1,p2])
        
box_ = [0 for i in range(N)]
num = box(0,box_)
if(num>=1e+20):
    print(-1)
else:
    print(num)
    
#宝箱はN(<=12)個

Fixed submission:
N = int(input())
if(N%2==0):
    print(0.5)
else:
    print((0.5*(N+1))/N)
Buggy python submission (verdict: Time Limit Exceeded):
A,B = input().split()
A,B = int(A),int(B)

min_ = (min([A,B]))
d = 2
cms = [1]
while(d<=min_):
    if(A%d==0 and B%d==0):
        min_ /= d
        A /= d
        B /= d
        min_ = (min([A,B]))
        if(d not in cms):
            cms.append(d)
    else:
        d+=1
        
print(len(cms))

Fixed submission:
import collections
A,B = input().split()
A,B = int(A),int(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 = collections.Counter(prime_factorize(A)).keys()
B = collections.Counter(prime_factorize(B)).keys()


cms = []
for a in A:
    for b in B:
        if(a==b):
            cms.append(a)
print(len(cms)+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B = input().split()
A,B = int(A),int(B)

lcm = 1
for i in range(1,max([A,B])+1):
    if(A%i==0 and B%i==0):
        lcm = i

d = 2
cms = [1]

while(lcm>1):
    if(lcm%d==0):
        lcm /= d
        if(d not in cms):
            cms.append(d)
    else:
        d += 1
print(len(cms))

Fixed submission:
import collections
A,B = input().split()
A,B = int(A),int(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 = collections.Counter(prime_factorize(A)).keys()
B = collections.Counter(prime_factorize(B)).keys()


cms = []
for a in A:
    for b in B:
        if(a==b):
            cms.append(a)
print(len(cms)+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B = input().split()
A,B = int(A),int(B)

lcm = 1
cms = []
for i in range(1,max([A,B])+1):
    if(A%i==0 and B%i==0):
        lcm = i
        cms.append(i)

d = 2
cms_dic = {}
cms = [1]
lcm_= lcm
while(lcm_>1):
    if(lcm_%d==0):
        lcm_ /= d
        if(str(d) in cms_dic.keys()):
            cms_dic[str(d)]+=1
        else:
            cms_dic[str(d)] = 1
            cms.append(d)
    else:
        d += 1
print(len(cms))

Fixed submission:
import collections
A,B = input().split()
A,B = int(A),int(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 = collections.Counter(prime_factorize(A)).keys()
B = collections.Counter(prime_factorize(B)).keys()


cms = []
for a in A:
    for b in B:
        if(a==b):
            cms.append(a)
print(len(cms)+1)
Buggy python submission (verdict: Runtime Error):
S = input()
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print(Sunny)

Fixed submission:
S = input()
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print("Sunny")

Buggy python submission (verdict: Runtime Error):
S = input()
Sunny, Cloudy, Rainy
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print(Sunny)

Fixed submission:
S = input()
if(S=="Sunny"):
    print("Cloudy")
elif(S=="Cloudy"):
    print("Rainy")
elif(S=="Rainy"):
    print("Sunny")