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

c=0
cc=3
tmp=[]
while c!=cc:
    cc=c
    for i in range(len(S)-1):
        if S[i]!=S[i+1] and S[i]!='2':
            S[i]='2'
            S[i+1]='2'
            c+=2

    while S:
        e=S.pop()
        if e!='2':
            tmp.append(e)
    while tmp:
        S.append(tmp.pop())

print(c)

Fixed submission:
S=input()

c0=0

for i in range(len(S)):
    if S[i]=='0':
        c0+=1

if len(S)>c0*2:
    print(2*c0)
else:
    print((len(S)-c0)*2)
Buggy python submission (verdict: Runtime Error):
N,A,B,C=map(int,input().split())

l=[int(input()) for i in range(N)]

INF=3000

def mp(co,a,b,c):
    if co==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(co+1,a,b,c)
    ret1=mp(co+1,a+1,b,c)+10
    ret2=mp(co+1,a,b+1,c)+10
    ret3=mp(co+1,a,b,c+1)+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))
N,A,B,C=map(int,input().split())

l=[int(input()) for i in range(N)]

INF=3000

def mp(co,a,b,c):
    if co==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(co+1,a,b,c)
    ret1=mp(co+1,a+1,b,c)+10
    ret2=mp(co+1,a,b+1,c)+10
    ret3=mp(co+1,a,b,c+1)+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))


Fixed submission:
N,A,B,C=map(int,input().split())

l=[int(input()) for i in range(N)]

INF=3000

def mp(co,a,b,c):
    if co==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(co+1,a,b,c)
    ret1=mp(co+1,a+l[co],b,c)+10
    ret2=mp(co+1,a,b+l[co],c)+10
    ret3=mp(co+1,a,b,c+l[co])+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))

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

l=[int(input()) for i in range(N)]

INF=3000

def mp(c,a,b,c):
    if c==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(c+1,a,b,c)
    ret1=mp(c+1,a+1,b,c)+10
    ret2=mp(c+1,a,b+1,c)+10
    ret3=mp(c+1,a,b,c+1)+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))


Fixed submission:
N,A,B,C=map(int,input().split())

l=[int(input()) for i in range(N)]

INF=3000

def mp(co,a,b,c):
    if co==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(co+1,a,b,c)
    ret1=mp(co+1,a+l[co],b,c)+10
    ret2=mp(co+1,a,b+l[co],c)+10
    ret3=mp(co+1,a,b,c+l[co])+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))

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

l=[int(input()) for i in range(N)]

INF=3000

def mp(c,a,b,c):
    return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(c+1,a,b,c)
    ret1=mp(c+1,a+1,b,c)+10
    ret2=mp(c+1,a,b+1,c)+10
    ret3=mp(c+1,a,b,c+1)+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))


Fixed submission:
N,A,B,C=map(int,input().split())

l=[int(input()) for i in range(N)]

INF=3000

def mp(co,a,b,c):
    if co==N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF

    ret0=mp(co+1,a,b,c)
    ret1=mp(co+1,a+l[co],b,c)+10
    ret2=mp(co+1,a,b+l[co],c)+10
    ret3=mp(co+1,a,b,c+l[co])+10

    return min(ret0,ret1,ret2,ret3)

print(mp(0,0,0,0))
Buggy python submission (verdict: Runtime Error):
  a,b=map(int,input().split())
  if a//2==0 or b//2==0:
    print('Even')
  else:
    print('Odd')


Fixed submission:
a,b=map(int,input().split())
if a%2==0 or b%2==0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())

c=0

for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k==S:
                c+=1

print(c)
                


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

c=0

for i in range(K+1):
    for j in range(K+1):
        if i+j+K>=S and i+j<=S:
            c+=1

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())

s = input().split()
d = len(s)

for i in range(d-1):
  for f in range(i+1, d):
    if s[i] == s[f]:
      print("NO")
      break
  else:
    continue
  break
else:
  print("YES")

Fixed submission:
a = int(input())

s = input().split()

e = set(s)
if len(s) == len(e):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
ns = []

for i in range(n):
  text = input()
  if s.count(text) != 0:
    ns[s.index(text)] += 1
  else:
    s.append(text)
    ns.append(1)

maxn = max(ns)
ms = []
for i in range(len(s)):
  if ns[i] == maxn:
    ms.append(s[i])

ms.sort()

for i in range(len(ms)):
  print(ms[i])

Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())

import collections
c = collections.Counter(s)
values, counts = zip(*c.most_common())

maxn = counts[0]
cnt = counts.count(maxn)
l = []
for i in range(cnt):
  l.append(values[i])

l.sort()

for i in range(len(l)):
  print(l[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().strip().split()))
flg = 0
for i in range(n):
  for j in range(n):
    if i != j:
      if a[i] == a[j]:
        flg += 1

if flg >= 1:
  print("NO")
else:
  print("YES")

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

def has_duplicates(seq):
    return len(seq) != len(set(seq))

if has_duplicates(a):
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().strip().split())
p = list(map(int, input().strip().split()))

e = []

for i in range(n):
  a = p[i] * (p[i] + 1) / 2
  e.append(a/p[i])

ans = 0  
for i in range(k-1,n):
  s = sum(e[i-(k-1):i+1])
  if ans < s:
    ans = s

print(ans)

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

e = []

for i in range(n):
  a = p[i] * (p[i] + 1) / 2
  e.append(a/p[i])

ans = sum(e[0:k])
s = ans

for i in range(k,n):
  aaa = s + e[i] - e[i-k]
  if ans < aaa:
    ans = aaa
  s = aaa
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, a = map(int, input().strip().split())

aaa = list(map(int, input().strip().split()))
h = sum(aaa)

for i in range(a):
  maxat = max(aaa)
  h -= maxat

if h <= 0:
  h = 0
print(h)

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

if n <= a:
  print(0)
else:
  aaa = list(map(int, input().strip().split()))

  aaa = sorted(aaa, reverse=True)
  h = 0
  for i in range(a, n):
    h += aaa[i]

  print(h)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().strip().split())

num = [0]*n
nn = []
WA = 0
AC = 0

for i in range(m):
  text = input().strip().split()
  p = int(text[0])
  s = text[1]
  
  if p not in nn:
    if s == 'AC':
      AC += 1
      WA += num[p-1]
      nn.append(p)
    elif s == 'WA':
      num[p-1] += 1
      
print(AC, WA)

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

num = [0]*n
nn = [-1]*n
WA = 0
AC = 0

for i in range(m):
  text = input().strip().split()
  p = int(text[0])
  s = text[1]
  
  if nn[p-1] == -1:
    if s == 'AC':
      AC += 1
      WA += num[p-1]
      nn[p-1] = 1
    elif s == 'WA':
      num[p-1] += 1
      
print(AC, WA)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().strip().split())

num = []
for i in range(n):
  num.append(i+1)

WA = 0
AC = 0

import numpy as np

ar = np.zeros((n, 2), dtype=np.int64)

for i in range(m):
  text = input().strip().split()
  p = int(text[0])
  s = text[1]
  
  if p in num:
    if s == 'AC':
      ar[p-1][1] = 1
      num.remove(p)
    elif s == 'WA':
      ar[p-1][0] += 1
      
for i in range(n):
  if ar[i][1] == 1:
    AC += 1
    WA += ar[i][0]
    
print(AC, WA)

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

num = [0]*n
nn = [-1]*n
WA = 0
AC = 0

for i in range(m):
  text = input().strip().split()
  p = int(text[0])
  s = text[1]
  
  if nn[p-1] == -1:
    if s == 'AC':
      AC += 1
      WA += num[p-1]
      nn[p-1] = 1
    elif s == 'WA':
      num[p-1] += 1
      
print(AC, WA)
Buggy python submission (verdict: Runtime Error):
 def main():
    n, a, b = map(int, input().split())
    if abs(a - b) % 2 == 0:
        print(abs(a - b) // 2)
    else:
        mi = min(a, b) - 1
        ma = n - max(a, b)
        print(min(mi, ma) + (abs(a - b) + 1 // 2))


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n, a, b = map(int, input().split())
    if abs(a - b) % 2 == 0:
        print(abs(a - b) // 2)
    else:
        mi = min(a, b) - 1
        ma = n - max(a, b)
        print(min(mi, ma) + (abs(a - b) + 1) // 2)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

if all(s[i] == '1' for i in range(k + 1)):
    print(1)

print(s.replace('1', '')[0])


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

for i in range(k):
    if s[i] == '1':
        continue
    else:
        print(s[i])
        break
else:
    print(1)

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

for i in range(k + 1):
    if s[i] == '1':
        continue
    else:
        print(s[i])
        break
else:
    print(1)


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

for i in range(k):
    if s[i] == '1':
        continue
    else:
        print(s[i])
        break
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
a = [int(x) for x in input().split()]

l = 0
r = sum(a)

d = math.inf

for i in range(n - 1):
    l += a[i]
    r -= a[i]
    d = min(d, abs(l - r))

print(d)


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

left = 0
right = sum(a)

diff = []

for i in range(n - 1):
    left += a[i]
    right -= a[i]
    diff.append(abs(left - right))

print(min(diff))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

print(min(abs(sum(a[:i]) - sum(a[i:])) for i in range(1, n)))

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

left = 0
right = sum(a)

diff = []

for i in range(n - 1):
    left += a[i]
    right -= a[i]
    diff.append(abs(left - right))

print(min(diff))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(len(a)):
    b.append(str(a[i]))
    b.reverse()

print(' '.join(b))


Fixed submission:
from collections import deque

n = int(input())
a = list(map(int, input().split()))

b = deque()

for i in range(len(a)):
    if i % 2 == 0:
        b.append(str(a[i]))
    else:
        b.appendleft(str(a[i]))
    last = i

if last % 2 == 0:
    b.reverse()

print(' '.join(b))
Buggy python submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())

diff = abs(n - m)

if diff > 1:
    print(0)
elif diff == 1:
    print(math.factorial(a) * math.factorial(b) % (10 ** 9 + 7))
else:
    print(math.factorial(a) * math.factorial(b) * 2 % (10 ** 9 + 7))


Fixed submission:
import math

n, m = map(int, input().split())

if abs(n - m) > 1:
    print(0)
    exit()

a = max(n, m)
b = min(n, m)


if a - b == 1:
    print(math.factorial(a) * math.factorial(b) % (10 ** 9 + 7))
else:
    print(math.factorial(a) * math.factorial(b) * 2 % (10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools


def main():
    n, m = map(int, input().split())

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

    s = 0
    for x in itertools.combinations(X, 2):
        for y in itertools.combinations(Y, 2):
            x_len = x[0] - x[1]
            y_len = y[0] - y[1]
            s += x_len * y_len

    print(s % (10 ** 9 + 7))


if __name__ == '__main__':
    main()


Fixed submission:
import itertools


def main():
    n, m = map(int, input().split())

    x = list(map(int, input().split()))
    y = list(map(int, input().split()))

    x_len = 0
    y_len = 0

    for i in range(n):
        x_len += (2 * i - n + 1) * x[i] % (10 ** 9 + 7)
        # print(x_len)

    for j in range(m):
        y_len += (2 * j - m + 1) * y[j] % (10 ** 9 + 7)
        # print(y_len)

    print(x_len * y_len % (10 ** 9 + 7))


if __name__ == '__main__':
    main()

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

def main():
    n, m = map(int, input().split())

    x = sorted(list(map(int, input().split())))
    y = sorted(list(map(int, input().split())))

    s = 0
    # x_len = 0
    # y_len = 0

    for e1 in itertools.combinations(x, 2):
        for e2 in itertools.combinations(y, 2):
            x_len = e1[0] - e1[1]
            y_len = e2[0] - e2[1]
            s += x_len * y_len

    print(s % (10 ** 9 + 7))

if __name__ == '__main__':
    main()

Fixed submission:
import itertools


def main():
    n, m = map(int, input().split())

    x = list(map(int, input().split()))
    y = list(map(int, input().split()))

    x_len = 0
    y_len = 0

    for i in range(n):
        x_len += (2 * i - n + 1) * x[i] % (10 ** 9 + 7)
        # print(x_len)

    for j in range(m):
        y_len += (2 * j - m + 1) * y[j] % (10 ** 9 + 7)
        # print(y_len)

    print(x_len * y_len % (10 ** 9 + 7))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())

a = reversed(sorted(a))
m = 0

for i in range(n, 2 * n):
    m += a[i]

print(m)

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

a = sorted(a, reverse=True)
m = 0

for i in range(1, 2 * n, 2):
    m += a[i]

print(m)
Buggy python submission (verdict: Runtime Error):
N = int(input())

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

dicts = sorted(dicts.items(), key=lambda x:x[1])
max_list = []

buf = dicts[1][1]
for k, v in dicts:
    if v == buf:
        max_list.append(k)
    else:
        break

for k in max_list:
    print(k)

Fixed submission:
N = int(input())

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

dicts = sorted(dicts.items(), key=lambda x:x[1], reverse=True)
max_list = []

buf = dicts[0][1]
for k, v in dicts:
    if v == buf:
        max_list.append(k)
    else:
        break

for k in sorted(max_list):
    print(k)

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

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

max_list = [kv[0] for kv in dicts.items() if kv[1] == max(dicts.values())]

for s in sorted(max_list):
    print(s)

Fixed submission:
N = int(input())

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

dicts = sorted(dicts.items(), key=lambda x:x[1], reverse=True)
max_list = []

buf = dicts[0][1]
for k, v in dicts:
    if v == buf:
        max_list.append(k)
    else:
        break

for k in sorted(max_list):
    print(k)

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

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

max_list = [kv[0] for kv in d.items() if kv[1] == max(dicts.values())]

print(sorted(max_list))

Fixed submission:
N = int(input())

dicts = {}

for _ in range(N):
    S = input()
    if S in dicts:
        dicts[S] += 1
    else:
        dicts[S] = 1

dicts = sorted(dicts.items(), key=lambda x:x[1], reverse=True)
max_list = []

buf = dicts[0][1]
for k, v in dicts:
    if v == buf:
        max_list.append(k)
    else:
        break

for k in sorted(max_list):
    print(k)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

ans = 0
buf = ""
for i in range(N):
    t = T[i]

    if t == "r":
        if i >= K:
            if buf[i - K] == "p":
                buf = buf + " "
                continue
        ans += P
        buf += buf + "p"
    elif t == "p":
        if i >= K:
            if buf[i - K] == "s":
                buf = buf + " "
                continue
        ans += S
        buf += buf + "s"
    elif t == "s":
        if i >= K:
            if buf[i - K] == "r":
                buf = buf + " "
                continue
        ans += R
        buf += buf + "r"

print(ans)

Fixed submission:
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

ans = 0
buf = ""
for i in range(N):
    t = T[i]

    if t == "r":
        if i >= K:
            if buf[i - K] == "p":
                buf = buf + " "
                continue
        ans += P
        buf = buf + "p"
    elif t == "p":
        if i >= K:
            if buf[i - K] == "s":
                buf = buf + " "
                continue
        ans += S
        buf = buf + "s"
    elif t == "s":
        if i >= K:
            if buf[i - K] == "r":
                buf = buf + " "
                continue
        ans += R
        buf = buf + "r"

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

edges = [[] for _ in range(N)]

for i in range(N - 1):
    a, b = map(int,input().split())
    edges[a - 1].append([b - 1, i])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    color = 1
    for b, i in edges[a]:
        if color == p_color:
            color += 1
        colors[i] = color
        func(b, color)
        color += 1

func(0, -1)

print(max(colors))
for c in colors:
    print(c)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())

edges = [[] for _ in range(N)]

for i in range(N - 1):
    a, b = map(int,input().split())
    edges[a - 1].append([b - 1, i])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    color = 1
    for b, i in edges[a]:
        if color == p_color:
            color += 1
        colors[i] = color
        func(b, color)
        color += 1

func(0, -1)

print(max(colors))
for c in colors:
    print(c)

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

edges = [[] for _ in range(N)]

for i in range(N - 1):
    a, b = map(int,input().split())
    edges[a - 1].append([b - 1, i])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    edge_index = []
    color = 1
    for b, i in edges[a]:
        if color == p_color:
            color += 1
        colors[i] = color
        func(b, color)
        color += 1

func(1, -1)

print(max(colors))
for c in colors:
    print(c)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())

edges = [[] for _ in range(N)]

for i in range(N - 1):
    a, b = map(int,input().split())
    edges[a - 1].append([b - 1, i])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    color = 1
    for b, i in edges[a]:
        if color == p_color:
            color += 1
        colors[i] = color
        func(b, color)
        color += 1

func(0, -1)

print(max(colors))
for c in colors:
    print(c)

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

edges = []

for _ in range(N - 1):
    a, b = map(int,input().split())
    edges.append([a, b])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    edge_index = []
    for i in range(N - 1):
        _a, _b = edges[i]
        if _a == a:
            edge_index.append(i)

    color = 1
    for e_i in edge_index:
        if color == p_color:
            color += 1
        __a, __b = edges[e_i]
        colors[e_i] = color
        func(__b, color)
        color += 1

func(1)

print(max(colors))
for c in colors:
    print(c)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())

edges = [[] for _ in range(N)]

for i in range(N - 1):
    a, b = map(int,input().split())
    edges[a - 1].append([b - 1, i])

colors = [-1] * (N - 1)

def func(a, p_color=-1):
    color = 1
    for b, i in edges[a]:
        if color == p_color:
            color += 1
        colors[i] = color
        func(b, color)
        color += 1

func(0, -1)

print(max(colors))
for c in colors:
    print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())

d = map(int, input().split())

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

print(total)

Fixed submission:
N = int(input())

d = list(map(int, input().split()))

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

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

prev = S[0]:

num = 1
for s in S[1:]:
    if prev != s:
        num += 1
    prev = s

print(num)

Fixed submission:
N = int(input())
S = input()

prev = S[0]

num = 1
for s in S[1:]:
    if prev != s:
        num += 1
    prev = s

print(num)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = sorted(map(int, input().split()))

counter = 0

for i in range(N):
    a = L[i]
    for j in range(i+1, N):
        b = L[j]
        for k in range(j+1, N):
            c = L[k]
            if c >= a + b:
                break
            elif b < c + a and a < b + c:
                counter += 1

print(counter)

Fixed submission:
import bisect

N = int(input())
L = sorted(map(int, input().split()))

counter = 0

for i in range(N):
    a = L[i]
    for j in range(i+1, N):
        b = L[j]
        k = bisect.bisect_left(L, a + b)
        counter += max(0, k - (j + 1))

print(counter)
Buggy python submission (verdict: Runtime Error):
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return act

print(len(list(set(factorize(C))) + 1)

Fixed submission:
N = int(input())

print(int(N / 2 + 0.5) / N)
Buggy python submission (verdict: Runtime Error):
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return act

print(len(list(set(factorize(C)))) + 1)

Fixed submission:
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return fct

print(len(list(set(factorize(C)))) + 1)

Buggy python submission (verdict: Runtime Error):
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return act

print(len(list(set(factorize(C))) + 1)

Fixed submission:
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return fct

print(len(list(set(factorize(C)))) + 1)

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

A, B = map(int, input().split())

C = math.gcd(A, B)

def factorization(n):
    count = 0
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            count += 1
            while temp % i == 0:
                temp //= i

    return count

print(factorization(C) + 1)

Fixed submission:
import fractions

A, B = map(int, input().split())

C = fractions.gcd(A, B)

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    return fct

print(len(list(set(factorize(C)))) + 1)