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

Fixed submission:
def solve():
    s = input()
    return "Bad" if any([s[i] == s[i + 1] for i in range(len(s) - 1)]) else "Good"


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    num_a = a - 1 - (a - 1) // c - (a - 1) // d + (a - 1) // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())
Problem p02995 (python)

Fixed submission:
import fractions


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // fractions.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    div_c = b // c - (a - 1) // c
    div_d = b // d - (a - 1) // d
    div_cd = b // lcm - (a - 1) // lcm
    return (b - a + 1) - div_c - div_d + div_cd


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    a -= 1
    num_a = a - a // c - a // d + a // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    num_a = a - 1 - (a - 1) // c - (a - 1) // d + (a - 1) // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    b_c = b // c
    b_d = b // d
    b_cd = b // lcm
    a_c = (a - 1) // c
    a_d = (a - 1) // d
    a_cd = (a - 1) // lcm
    return b - b_c - b_d + b_cd - (a - 1 - a_c - a_d + a_cd)


if __name__ == "__main__":
    print(solve())
Problem p03035 (python)

Fixed submission:
def solve():
    a, b = map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else:
        return 0


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    a, b= map(int, input().split())
    if a > 12:
        return b
    elif 6 <= a <= 12:
        return b // 2
    else
        return 0
        


if __name__ == "__main__":
    print(solve())
Problem p03076 (python)

Fixed submission:
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    if any([str(i)[-1] != "0" for i in abcde]):
        last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    else:
        last = min(abcde)
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    hoge = sum([math.ceil(i / 10) * 10 for i in abcde]) - (math.ceil(last / 10) * 10)
    print(hoge + last)


if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
import math


def solve():
    abcde = [int(input()) for _ in range(5)]
    last = min([i for i in abcde if not str(i)[-1] == "0"], key=lambda x: abs(int(str(x)[-1])))
    hoge = sum([math.ceil(int(i) / 10) * 10 for i in abcde if not i == last])
    print(hoge + last)


if __name__ == "__main__":
    solve()
Problem p03206 (python)

Fixed submission:
def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" * eves


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" + eves


if __name__ == "__main__":
    print(solve())
Problem p03219 (python)

Fixed submission:
def solve():
    x, y = map(int, input().split())
    return x + y // 2


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    x, y = map(int, input())
    return x + y // 2


if __name__ == "__main__":
    print(solve())
Problem p03238 (python)

Fixed submission:
def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = list(int(input()) for _ in range(2))
    return a + b


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = map(int, input().split())
    return a + b


if __name__ == "__main__":
    print(solve())
Problem p03244 (python)

Fixed submission:
from collections import defaultdict


def resolve():
    n = int(input())
    v = list(map(int, input().split()))
    d_o = defaultdict(int)
    d_e = defaultdict(int)
    for i in range(n):
        if i % 2:
            d_o[v[i]] += 1
        else:
            d_e[v[i]] += 1
    d_e[0] = 0
    d_o[0] = 0
    de = sorted(d_e.items(), key=lambda x: -x[1])
    do = sorted(d_o.items(), key=lambda x: -x[1])
    if de[0][0] != do[0][0]:
        print(n - de[0][1] - do[0][1])
    else:
        p01 = de[0][1] + do[1][1]
        p10 = de[1][1] + do[0][1]
        print(n - max(p01, p10))


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict


def resolve():
    n = int(input())
    v = list(map(int, input().split()))
    d_o = defaultdict(int)
    d_e = defaultdict(int)
    for i in range(n):
        if i % 2:
            d_o[v[i]] += 1
        else:
            d_e[v[i]] += 1
    de = sorted(d_e.items(), key=lambda x: x[1])
    do = sorted(d_o.items(), key=lambda x: x[1])
    if de == do:
        p = max(de[0][1], do[0][1])
        print(n - p)
    if de[0] != do[0]:
        print(n - de[0][1] - do[0][1])
    else:
        p = max(de[0][1] + do[1][1], de[1][1] + do[0][1])
        print(n - p)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict


def resolve():
    n = int(input())
    v = list(map(int, input().split()))
    d_o = defaultdict(int)
    d_e = defaultdict(int)
    for i in range(n):
        if i % 2:
            d_o[v[i]] += 1
        else:
            d_e[v[i]] += 1
    de = sorted(d_e.items(), key=lambda x: x[1])
    do = sorted(d_o.items(), key=lambda x: x[1])
    if de == do:
        p = max(de[0][1], do[0][1])
        print(n - p)
    if de[0] != do[0]:
        print(n - de[0][1] - do[0][1])
    else:
        p = max(de[0][1] + do[1][1], de[1][1] + do[0][1])
        print(p)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict


def resolve():
    n = int(input())
    v = list(map(int, input().split()))
    d_o = defaultdict(int)
    d_e = defaultdict(int)
    for i in range(n):
        if i % 2:
            d_o[v[i]] += 1
        else:
            d_e[v[i]] += 1
    de = sorted(d_e.items(), key=lambda x: x[1])
    do = sorted(d_o.items(), key=lambda x: x[1])
    if de == do:
        p = max(de[0][1], do[0][1])
        print(n - p)
    if de[0] != do[0]:
        print(n - de[0][1] - do[0][1])
    else:
        p = max(de[0] + do[1], de[1] + do[0])
        print(p)


if __name__ == "__main__":
    resolve()
Problem p03262 (python)

Fixed submission:
from functools import reduce
import fractions


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(fractions.gcd, diffs)


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(math.gcd, diffs)


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math


def solve():
    n, X = map(int, input().split())
    xs = list(map(int, input().split()))
    diffs = [abs(x - X) for x in xs]
    return reduce(math.gcd, diffs)


if __name__ == "__main__":
    print(solve())
Problem p03274 (python)

Fixed submission:
def solve():
    n, k = map(int, input().split())
    xs = list(map(int, input().split()))
    min_dist = 10 ** 9
    for i in range(n - k + 1):
        length = abs(xs[i] - xs[i + k - 1])
        dist = min(abs(xs[i]) + length, abs(xs[i + k - 1]) + length)
        if dist < min_dist:
            min_dist = dist
    return min_dist


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    n, k = map(int, input().split())
    xs = list(map(int, input().split()))
    dists = []
    for i in range(n - k):
        part = xs[i:i + k]
        dist = min(abs(part[0]) + abs(part[0] - part[-1]), abs(part[-1]) + abs(part[0] - part[-1]))
        dists.append(dist)
    return min(dists)


if __name__ == "__main__":
    print(solve())
Problem p03282 (python)

Fixed submission:
def solve():
    s = input()
    k = int(input())
    head_ones = 0
    for c in s:
        if c != "1":
            break
        else:
            head_ones += 1

    return "1" if head_ones >= k else [c for c in s if c != "1"][0]


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
def solve():
    s = input()
    return [c for c in s if c != "1"][0]


if __name__ == "__main__":
    print(solve())
Problem p03294 (python)

Fixed submission:
import fractions
from functools import reduce


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    lcm_a = lcm(*a)
    fm = sum([(lcm_a - 1) % ai for ai in a])
    return fm


def lcm_base(x, y):
    return x * y // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    lcm_a = lcm(*a)
    fm = sum([(lcm_a - 1) % ai for ai in a])
    return fm


def lcm_base(x, y):
    return x * y // math.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    print(solve())
Problem p03337 (python)

Fixed submission:
def resolve():
    a, b = map(int, input().split())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, = int(input())
    ans = max([a + b, a - b, a * b])
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, = int(input())
    ans = max(a + b, a - b, a * b)
    print(ans)


if __name__ == "__main__":
    resolve()
Problem p03353 (python)

Fixed submission:
def resolve():
    s = input()
    k = int(input())
    l = len(s)
    subs = []
    for i in range(l):
        for j in range(i + 1, i + k + 1):
            sub = s[i:j]
            if sub not in subs:
                subs.append(sub)
    print(sorted(set(subs))[k - 1])


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    s = input()
    k = int(input())
    l = len(s)
    subs = set()
    for i in range(l):
        for j in range(i + 1, l):
            sub = s[i:j]
            print(sub)
            subs.add(sub)
    return sorted(subs)[k - 1]


if __name__ == "__main__":
    print(resolve())
Problem p03386 (python)

Fixed submission:
def resolve():
    a, b, k = list(map(int, input().split()))
    s = set()
    for i in range(a, min(a + k, b + 1)):
        s.add(i)
    for i in range(max(a, b - k + 1), b + 1):
        s.add(i)
    for i in sorted(s):
        print(i)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, k = list(map(int, input().split()))
    small = list(range(a, b))[:k]
    large = list(range(a, b + 1))[::-1][:k]
    ans = sorted(set(small + large))
    for i in ans:
        print(i)


if __name__ == "__main__":
    resolve()
Problem p03633 (python)

Fixed submission:
from fractions import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    res = 1
    for ti in t:
        res = lcm_base(res, ti)
    print(res)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    print(lcm(t))


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def resolve():
    n = int(input())
    t = list(int(input()) for _ in range(n))
    ans = lcm(t)
    print(ans)


def lcm_base(x, y):
    return x * y // gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == "__main__":
    resolve()
Problem p03644 (python)

Fixed submission:
def resolve():
    n = int(input())
    ans = 0
    for i in range(2, n + 1, 2):
        c = 0
        while i % 2 == 0:
            i //= 2
            c += 1
        if c > ans:
            ans = c
    print(2 ** ans)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
import math


def resolve():
    n = int(input())
    print(2 ** int(math.log2(n)))


if __name__ == "__main__":
    resolve()
Problem p03997 (python)

Fixed submission:
def resolve():
    a = int(input())
    b = int(input())
    h = int(input())
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, h = map(int, input().split())
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, h = list(map(int, input().split()))
    print((a + b) * h // 2)


if __name__ == "__main__":
    resolve()
Problem p03998 (python)

Fixed submission:
def resolve():
    a = list(input())
    b = list(input())
    c = list(input())
    d = {"a": a, "b": b, "c": c}
    now = "a"
    while d[now]:
        now = d[now].pop(0)
    print(now.upper())


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a = input()
    b = input()
    c = input()
    d = {"a": a, "b": b, "c": c}
    now = d["a"][0]
    d["a"] = d["a"][1:]
    next = d[now][0]
    while True:
        if len(d[next]) == 0:
            print(next.upper())
            return 0
        next = d[next][0]
        d[next] = d[next][1:]


if __name__ == "__main__":
    resolve()
Problem p04035 (python)

Fixed submission:
def resolve():
    n, l = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n - 1):
        if a[i] + a[i + 1] >= l:
            print("Possible")
            for j in range(i):
                print(j + 1)
            for j in range(n - 1, i, -1):
                print(j)
            return 0
    print("Impossible")


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n, l = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n):
        if a[i] + a[i + 1] >= l:
            last = i
            print("Possible")
            for j in range(last):
                print(i)
            for j in range(last + 1, n):
                print(i)
            print(last)
            return 0
    print("Impossible")
    return 0


if __name__ == "__main__":
    resolve()
Problem p02887 (python)

Fixed submission:
num=int(input())
data=list(input())
 
count=1
for i in range(num-1):
  if data[i] is not data[i+1]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
num=int(input())
data=list(input())
 
count=1
for i in range(num-1):
  if data[i]=!data[i+1]:
    count+=1
print(count)

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

count=1
for i in range(num-1):
  if data[i]=!data[i+1]:
    count+=1
print(count)
Problem p02900 (python)

Fixed submission:
import fractions

def factor(x):
  t = x
  p = [1]
  for i in range(2, -int(-x**0.5//1)+1):
    if x % i == 0:
      p += [i]
      while x % i == 0:
        x /= i
  if len(p) == 1 and t != 1:
    p += [t]
  return p

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


A, B = list(map(int, input().split()))
d = fractions.gcd(A, B)
#p = factor(d)
p = factorization(d)
#print(p)
print(len(p) + (0 if p[0][0] == 1 else 1))

Buggy submission (verdict: Runtime Error):
import fractions

def factor(x):
  t = x
  p = [1]
  for i in range(2, -int(-x**0.5//1)+1):
    if x % i == 0:
      p += [i]
      while x % i == 0:
        x /= i
  if len(p) == 1:
    p += t
  return p

A, B = list(map(int, input().split()))
d = fractions.gcd(A, B)
p = factor(d)
print(len(p))
Problem p03308 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
 
mn = 10 ** 9
mx = 0
 
for i in range(n):
  if a[i] < mn:
    mn = a[i]
    
  if a[i] > mx:
    mx = a[i]
  
print(mx - mn)

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

mn = 10 ** 9
mx = 0

for i in range(n):
  if a[i] < mn:
    mn = a[i]
    
  if a[i] > mx:
    mx = a[i]

print(mx - mn)
Problem p03316 (python)

Fixed submission:
s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
n=int(s)
sn=0
for d in s:
  sn+=int(d)
if n%sn==0:
  Print("Yes")
else:
  print("No")
Problem p04044 (python)

Fixed submission:
N,L = map(int, input().split())
S = N*[""] 
for i in range(N):
    S[i] = input()

S.sort()

str = ""

for s in S:
    str += s

print(str)

Buggy submission (verdict: Runtime Error):
N,L = map(int, input().split())
S = 26*[""] 
for i in range(N):
    S[i] = input()

S.sort()

str = ""

for s in S:
    str += s

print(str)
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
print(max(a+b,a-b,a*b))
Problem p02882 (python)

Fixed submission:
import numpy as np

def main():
	A, B, X = [int(x) for x in input().split()]

	if (A * A * B) / 2.0 >= X:
		y = (2 * X) / (A * B)
		R = np.arctan(y / B)
		print(90 - np.rad2deg(R))
	else:
		_x = (A * A * B) - X
		y = (2 * _x) / (A * A)
		try:
			R = np.arctan(A / y)
			print(90 - np.rad2deg(R))
		except:
			print(0.000000000)
		
	
if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
	A, B, X = [int(x) for x in input().split()]

	if (A * A * B) / 2.0 >= X:
		y = (2 * X) / (A * B)
		R = np.arctan(y / B)
		print(90 - np.rad2deg(R))
	else:
		_x = (A * A * B) - X
		y = (2 * _x) / (A * A)
		R = np.arctan(A / y)
		print(90 - np.rad2deg(R))
	
if __name__ == "__main__":
	main()
Problem p02861 (python)

Fixed submission:
from itertools import permutations
import numpy as np

def calc_distance(point):
    _point = np.array(list(point))
    x = np.diff(_point, axis=0)
    every_distance = np.linalg.norm(x, axis=1)
    all_distance = np.sum(every_distance)
    return all_distance

n = int(input())
points = [[int(v) for v in input().split(' ')] for _ in range(n)]

sum = 0
for v in permutations(points):
    sum += calc_distance(v)


print(sum / len(list(permutations(points))))

Buggy submission (verdict: Runtime Error):
from itertools import permutations
import numpy as np

def calc_distance(point):
    _point = np.array(list(point))
    x = np.diff(_point, axis=0)
    every_distance = np.linalg.norm(x, axis=1)
    all_distance = np.sum(every_distance)
    return all_distance

n = int(input())
points = [[int(v) for v in input().split(' ')] for _ in range(n)]

sum = 0
for v in permutations(points):
    sum += calc_distance(v)


print(sum / len(list(permutations(points))))
Problem p02900 (python)

Fixed submission:
from fractions import gcd
a, b = [int(i) for i in input().split(' ')]
gcd = gcd(a, b)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if gcd == 1:
    print(1)
else:
    print(len(factorization(gcd)) + 1)

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = [int(i) for i in input().split(' ')]
gcd = gcd(a, b)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if gcd == 1:
    print(1)
else:
    print(len(factorization(gcd)) + 1)

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = [int(i) for i in input().split(' ')]
gcd = gcd(a, b)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if gcd == 1:
    print(1)
else:
    print(len(factorization(gcd)) + 1)
Problem p02910 (python)

Fixed submission:
string = input()

def jadge_humiyasui(string):
    label1 = True
    label2 = True

    for i, str in enumerate(string):
        if i % 2 == 0:
            if str not in ['R', 'U', 'D']:
                label1 = False
        else:
            if str not in ['L', 'U', 'D']:
                label2 = False

    if label1 & label2:
        print('Yes')
    else:
        print('No')

jadge_humiyasui(string)

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

def jadge_humiyasui(string):
    for i, str in enumerate(string):
        if i % 2 == 0:
            label1 = str in ['R', 'U', 'D']
        else:
            label2 = str in ['L', 'U', 'D']

    if label1 & label2:
        print('Yes')
    else:
        print('No')

jadge_humiyasui(string)