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

Fixed submission:
def solve():
    from sys import stdin
    f_i = stdin
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        dp_i = dp[i]
        dp_pre = dp[i-1]
        dp_i[:A_i] = dp_pre[:A_i]
        for j, t in enumerate(zip(dp_pre[A_i:], dp_pre), start=A_i):
            x, y = t
            if x < y + B_i:
                dp_i[j] = y + B_i
            else:
                dp_i[j] = x
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    print(ans)

solve()

Buggy submission (verdict: Runtime Error):
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('ABC_145_E_in_s4')#
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        dp_i = dp[i]
        dp_pre = dp[i-1]
        for j, t in enumerate(zip(dp_pre[A_i:], dp_pre), start=A_i):
            x, y = t
            if x < y + B_i:
                dp_i[j] = y + B_i
            else:
                dp_i[j] = x
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    ans = max(ans, dp[-1][-1])
    print(ans)

solve()

Buggy submission (verdict: Runtime Error):
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('ABC_145_E_in_s3')#
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        for j in range(A_i, T):
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-A_i] + B_i)
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    print(ans)

solve()
Problem p02754 (python)

Fixed submission:
import sys

f = sys.stdin.readline()
xx = f.split(' ')
x = [int(str) for str in xx]

n = x[0]
a = x[1]
b = x[2]


ab = a + b

d = int(n / ab)
m = n % ab

if ( a > m):
	sum = a * d + m
else:
	sum = a * d + a

print sum
sys.stdout.flush()

Buggy submission (verdict: Runtime Error):
import sys

f = sys.stdin.readline()
xx = f.split(' ')
x = [int(str) for str in xx]

n = x[0]
a = x[1]
b = x[2]

count = 0
sum = 0
while 1:
  for i in range(0, a):
  	count += 1
	if( count > n):
		break
	sum += 1
  if( count > n):
	break
  for i in range(0, b):
  	count += 1
	if( count > n):
		break
  else:
  	continue
  break

print sum
sys.stdout.flush()

Buggy submission (verdict: Runtime Error):
import sys

f = sys.stdin.readline()
xx = f.split(' ')
x = [int(str) for str in xx]

n = x[0]
a = x[1]
b = x[2]

count = 0
sum = 0
while 1:
  for i in range(0, a):
  	count += 1
	if( count > n):
		break
	sum += 1
  for i in range(0, b):
  	count += 1
	if( count > n):
		break
  else:
  	continue
  break

print sum
sys.stdout.flush()
Problem p02759 (python)

Fixed submission:
import sys

x = sys.stdin.readline()
x = int((int(x)+1)/2)
print(x)

sys.stdout.flush()

Buggy submission (verdict: Runtime Error):
import sys

ar = []
x = sys.stdin.readline()
x = x.split(' ')
(n,m)=[int(str) for str in x]

ret = 0
chk = []
for i in range(m):
  x = sys.stdin.readline()
  x = x.split(' ')
  (s,c)=[int(str) for str in x]
  if not ( s in chk):
    if(n-s>=0):
      ret += c*10**(n-s)
      chk.append(s)
  else:
      if( c != int(ret/10**(n-s))):
        print("-1")
        exit(0)

if( ret == 0 and n == 1):
  print("0")
  exit(0)
if( ret < 10**(n-1)):
  if not ( n-1 in chk):
    print(ret+10**(n-1))
  else:
    print("-1")
else:
  print(ret)
sys.stdout.flush()

Buggy submission (verdict: Runtime Error):
import sys

ar = []
x = sys.stdin.readline()
x = x.split(' ')
(n,m)=[int(str) for str in x]

ret = 0
chk = []
for i in range(m):
  x = sys.stdin.readline()
  x = x.split(' ')
  (s,c)=[int(str) for str in x]
  if not ( s in chk):
    if(n-s>=0):
      ret += c*10**(n-s)
      chk.append(s)
  else:
      if( c != int(ret/10**(n-s))):
        print("-1")
        exit(0)


if( ret == 0 and n == 1):
  print("0")
  exit(0)
if( ret < 10**(n-1)):
  if not ( n-1 in chk):
    print(ret+10**(n-1))
  else:
    print("-1")
else:
  print(ret)
sys.stdout.flush()
Problem p02831 (python)

Fixed submission:
import operator
import functools

A, B = input().split()

A = int(A)
B = int(B)

value = []

count = 0

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

primeA = prime_factorize(A)

primeB = prime_factorize(B)


for i in range(len(primeA)):
    for j in range(len(primeB)):
        if primeA[i] == primeB[j]:
            value.append(primeA[i])
            primeA[i] = 1
            primeB[j] = 1
            break
        else:
            continue

value = value + primeA + primeB

result = functools.reduce(operator.mul, value)

print(result)

Buggy submission (verdict: Runtime Error):
import math

A, B = input().split()

A = int(A)
B = int(B)


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

print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import operator
import functools

import math


A, B = input().split()

A = int(A)
B = int(B)


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

print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import operator
import functools

import math


A, B = input().split()

A = int(A)
B = int(B)

"""

value = []

count = 0

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

primeA = prime_factorize(A)

primeB = prime_factorize(B)

if len(primeA) < len(primeB):
    for i in range(len(primeA)):
        for j in range(len(primeB)):
            if primeA[i] == primeB[j]:
                value.append(primeA[i])
                primeA[i] = 1
                primeB[j] = 1
                print(primeA)
                print(primeB)
                break
            else:
                continue

else:
    for i in range(len(primeB)):
        for j in range(len(primeA)):
            if primeB[i] == primeA[j]:
                value.append(primeB[i])
                primeA[j] = 1
                primeB[i] = 1
                print(primeA)
                print(primeB)
                break
            else:
                continue

value = value + primeA + primeB

result = functools.reduce(operator.mul, value)

print(result)
"""

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

print(lcm(A, B))
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
seta = set(a)
if len(a)==len(seta):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
 n = int(input())
    a = list(map(int, input().split()))
    seta = set(a)
    ans = 'YES' if len(a) == len(seta) else 'NO'
    print(ans)

Buggy submission (verdict: Runtime Error):
 n = int(input())
    a = list(map(int, input().split()))
    seta = set(a)
    ans = 'YES' if len(a) == len(seta) else 'NO'
    print(ans)
Problem p02699 (python)

Fixed submission:
S, W = map(int,input().split())
if S <= W :
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S <= W :
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
S,W = int(input())
if S <= W : print("unsafe")
else: print("safe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S <= W : print("unsafe")
else: print("safe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S <= W : print("safe")
else: print("unsafe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S >= W : print('safe')
else: print('unsafe')

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S >= W : print("safe")
else: print("unsafe")
Problem p02701 (python)

Fixed submission:
n = int(input())
s = set(input() for _ in range(n))
print(len(s))

Buggy submission (verdict: Runtime Error):
A=map(int,input().split())
list = []
for n in range(A):
	con = str(input())
	if con not in list:
		list.append(con)
	else: pass
print(str(len(list)))
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
A = map(int,input().split())
B = map(int,input().split())
if 1 <= A <= 9 and 1<= B <= 9:
	print(A*B)
else:
	print(-1)

Buggy submission (verdict: Runtime Error):
A = map(int,input())
B = map(int,input())
if 1 <= A <= 9 and 1<= B <= 9:
	print(A*B)
else:
	print(-1)
Problem p02881 (python)

Fixed submission:
n = int(input())
ans = float('inf')
 
for i in range(1, 10**6+1):
    q, m = divmod(n, i)
    if m == 0:
        ans = min(ans, q+i)
 
print(ans-2)

Buggy submission (verdict: Runtime Error):
import math
ans = 10**12
n = int(input())
for a in range(1,int(math.sqrt(n)):
  for b in range(1,int(math.sqrt(n)):
    if a * b == n:
      ans_n = a + b -2
      if ans > ans_n:
        ans = ans_n
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans = 10**12
n = int(input())
for a in range(1,int(math.sqrt(N)):
  for b in range(1,int(math.sqrt(N)):
    if a * b == n:
      ans_n = a + b -2
      if ans > ans_n:
        ans = ans_n
print(ans)

Buggy submission (verdict: Runtime Error):
ans = 10**12
n = int(input())
for a in range(1,int(math.sqrt(N)):
  for b in range(1,int(math.sqrt(N)):
    if a * b == n:
      ans_n = a + b -2
      if ans > ans_n:
        ans = ans_n
print(ans)
Problem p02699 (python)

Fixed submission:
SW = list(map(int,input().split()))
if (SW[0] > SW[1]):
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
  1 SW = list(map(int,input().split()))
SW = list(map(int,input().split()))
if (SW[0] > SW[1]):
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if (S > W):
  print("safe")
else:
  print("unsafe")
Problem p02701 (python)

Fixed submission:
n=int(input())
a=[]
 
for i in range(n):
  word=input()
  a.append(word)
print(len(set(a)))

Buggy submission (verdict: Runtime Error):
# coding:utf-8

n=int(input())
gacha_list[input() for i in range()]
gacha_prize=list(set(gacha_list())
print(len(gacha_prize()))
Problem p02699 (python)

Fixed submission:
x = list(map(int,input().split()))
if x[0] > x[1]:
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
if x[0] < x[1] :
  print("safe")
  else:
    print("unsafe")
Problem p02699 (python)

Fixed submission:
s, w = input().split()
if int(s) <= int(w):
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(n):
  s.append(input())
print(len(set(s))
Problem p02701 (python)

Fixed submission:
n = int(input())
s = []
for _ in range(n):
  s.append(input())
print(len(set(s)))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for _ in range(input()):
  s.append(input())
print(len(set(s)))
Problem p03127 (python)

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

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a%b)

E = gcd(A[0], A[1])
if n == 2: print(E)
else:
    for i in range(2, n):
        E = gcd(E, A[i])
    print(E)

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

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

print(functools.reduce(math.gcd, A))
Problem p03207 (python)

Fixed submission:
N = int(input())
p = [int(input()) for _ in range(N)]
p = sorted(p)
print(sum(p[:]) - p[-1]//2)

Buggy submission (verdict: Runtime Error):
N = int(input())
table = []
for i in range(N):
    table.append(int(input()))
print(sum(table[:]) - max(table) * // 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
table = set()
for i in range(N):
    table.add(int(input()))
print(sum(table[:]) - max(table) * // 2)
Problem p03315 (python)

Fixed submission:
S = input()
print(S.count("+") - S.count("-"))

Buggy submission (verdict: Runtime Error):
S = raw_input()
print(S.count("+") - S.count("-"))
Problem p02912 (python)

Fixed submission:
import heapq

N,M = map(int, input().split())
A = [-int(n) for n in input().split()]

heapq.heapify(A)
for x in range(M):
	heapq.heappush(A, heapq.heappop(A)/2)
A_int = map(int, A)
print(-sum(A_int))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = []
for X in input().split():
	x = int(X)
	A.append(x)

for x in range(M):
	max = A.index(max(A))
	A[max] = A[max] / 2

sum = 0
for x in range(len(A)):
	sum += int(A[x])

print(sum)
Problem p02915 (python)

Fixed submission:
N = int(input())
print(N*N*N)

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

p = 0
while K > 0 and p < len(S):
	now = S[p]
	p += 1
	if p >= len(S):
		break
	while now == S[p]:
		p += 1
		if p >= len(S):
			break

	q = p + 1
	if q >= len(S):
		"""
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		"""
		break
	while S[p] == S[q]:
		q += 1
		if q >= len(S):
			break
	while p < q:
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		p += 1
		if p >= len(S):
			break
	K -= 1

ret = 0;
print(len(S))
for x in range(len(S)-1):
	print(x)
	if S[x] == S[x + 1]:
		ret += 1
print(ret)
Problem p02701 (python)

Fixed submission:
n = int(input())
S = {input() for i in range(n)}
ans = len(S)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = {input() for 0 in range(n)}
ans = len(S)
print(ans)
Problem p02729 (python)

Fixed submission:
N,M=map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)

Buggy submission (verdict: Runtime Error):
 N,M=map(int, input().split())
print(N*(N-1)//2+M*(M-1)//2)
Problem p02829 (python)

Fixed submission:
A=int(input())
B=int(input())
print((6-A-B))

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
print((6-A-B))

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
print(int(6-A-B))

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
print(6-A-B)
Problem p02847 (python)

Fixed submission:
S = input()
if S=='SUN':
    n=7
elif S=='MON':
    n=6
elif S=='TUE':
    n=5
elif S=='WED':
    n=4
elif S=='THU':
    n=3
elif S=='FRI':
    n=2
else:
    n=1
print(n)

Buggy submission (verdict: Runtime Error):
Cal={'SUN':7 , 'MON':6 , 'TUE':5 , 'WED':4 , 'THU':3 , 'FRI':2 , 'SUT':1}
print(Cal[input()])
Problem p02701 (python)

Fixed submission:
row = int(input())
item_list = [input() for i in range(row)]
print(len(set(item_list)))

Buggy submission (verdict: Runtime Error):
row = int(input())
item_list = [input() for i in range(row)]
result_list = []
for j in item_list:
  exist_in_item_list = False
  for k in result_list.len():
    if result_list[k] == item_list[j]:
      exist_in_item_list = True
      break
  if not exist_in_item_list:
    result_list.append(item_list[j])

print(result_list.len())

Buggy submission (verdict: Runtime Error):
row = int(input())
item_list = [input() for i in range(row)]
result_list = []
for j in item_list:
  exist_in_item_list = False
  for k in result_list.len():
    if result_list[k] == item_list[j]:
      exist_in_item_list = True
      break
  result_list.append(item_list[j])

print(result_list.len())
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
print('unsafe' if w>=s else 'safe')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
takahashi = [a, b] if a>b else [b, a]
aoki = [c, d] if c>d else [d, c]
attackers = [takahashi, aoki]
attacker = 0

while 0 not in takahashi and 0 not in aoki:
  attackers[attacker^1][1] = max(0, attackers[attacker^1][1]-attackers[attacker][0])
  attackers[attacker^1].sort(reverse=True)
  attacker = attacker^1

if 0 in attackers[0]:
  print('No')
else:
  print('Yes')
Problem p03011 (python)

Fixed submission:
a,b,c = map(int, raw_input().split())
if a >=b and a>=c:
  print b+c
elif b>=a and b>=c:
  print a+c
else:
  print a+b

Buggy submission (verdict: Runtime Error):
print(sum(map(int, raw_input().split()).sort()[:2]))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int raw_input().split())
if a >=b and a>=c:
  print b+c
elif b>=a and b>=c:
  print a+c
else:
  print a+b
Problem p03038 (python)

Fixed submission:
n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [list(map(int, raw_input().split())) for i in range(m)]
y.sort(key = lambda x: x[1], reverse=True)
y_pos = 0
for index, value in enumerate(x):
  b = y[y_pos][0]
  c = y[y_pos][1]
  if value < c:
	  x[index] = c
	  y[y_pos][0] = b-1
	  if b == 1:
		  y_pos += 1
		  if y_pos == len(y):
			  break
  else:
	  break

print(sum(x))

Buggy submission (verdict: Runtime Error):
n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [tuple(map(int, raw_input().split())) for i in range(m)]
y = sorted(key = lambda x: x[1], reverse=True)
for b,c in y:
  while x[b-1] > c and b > 0:
    b -= 1
  x[0:b] = [c]*b
  x.sort()
print(sum(x))

Buggy submission (verdict: Runtime Error):
n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [tuple(map(int, raw_input().split())) for i in range(m)]
for b,c in y:
  while x[b-1] > c:
    b -= 1
  x[0:b] = [c]*b
  x.sort()
print(sum(x))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
x = list(map(int, input().split())).sort()
y = [tuple(map(int, input().split())) for i in range(m)]
for b,c in y:
  while x[b-1] > c:
    b -= 1
  x[0:b] = [c]*b
  x.sort(()
Problem p02891 (python)

Fixed submission:
s = list(input())
s2 = s[:]
k = int(input())

s1_count = 0
for i in range(1, len(s)):
    if s[i-1] == s[i]:
        s1_count += 1
        s[i] = '-'

if k == 1:
    print(s1_count)
elif s[0] != s[-1]:
    print(s1_count * k)
elif len(list(set(s2))) == 1:
    if len(s) % 2 == 0:
        print(s1_count * k)
    else:
        s2_count = s1_count + 1
        if k % 2 == 0:
            print(int((s1_count + s2_count) * (k // 2)))
        else:
            print(int((s1_count + s2_count) * (k // 2) + s1_count))
else:
    s2_count = 0
    if s[-1] == '-':
        print(s1_count * k)
    else:
        s2[0] = '-'
        s2_count += 1
        for i in range(1, len(s2)):
            if s2[i-1] == s2[i]:
                s2_count += 1
                s2[i] = '-'
        print(s1_count + s2_count * (k-1))

Buggy submission (verdict: Runtime Error):
# 時間かかりすぎ
s = list(input())
k = int(input())
t = s * k

count = 0
for i in range(1, len(t)):
    if t[i-1] == t[i]:
        count += 1
        t[i] = '-'
print(count)
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
def f():
  if W >= S:
    return "unsafe"
  else:
    return "safe"
print(f())

Buggy submission (verdict: Runtime Error):
import tensorflow
S, W = map(int, input().split())
def f():
  if W >= S:
    return "unsafe"
  else:
    return "safe"
print(f())
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0] * n
for i in range(len(a)):
    ans[a[i]-1] += 1
for i in range(n):
    print(ans[i])

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

x = [0]*n
j = 0
for i in range(n):
    k = 0
    while j < n-1:
        if i+1 == a[j]:
            j=j+1
            k=k+1
        else:
            break
    x[i] = k

ans = [print(_) for _ in x]
Problem p02847 (python)

Fixed submission:
S = input()
 
dict = {
  'SUN': 0,
  'MON': 1,
  'TUE': 2,
  'WED': 3,
  'THU': 4,
  'FRI': 5,
  'SAT': 6
}
 
print(7 - dict[S])

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

dict = {
  'SUN': 0
  'MON': 1,
  'TUE': 2,
  'WED': 3,
  'THU': 4,
  'FRI': 5,
  'SAT': 6,
}

print(7 - dict[S])
Problem p02831 (python)

Fixed submission:
def euclidean_algorithm(a, b):
    if a < b:
        tmp = b
        b = a
        a = tmp

    ｑ = a // b
    r = a % b
    while r != 0:
        a = b
        b = r
        q = a // b
        r = a % b

    return b


def main():
    a, b = map(int, input().split())

    #ユークリッド互除法(最大公約数)
    gcd = euclidean_algorithm(a, b)

    # 最小公倍数
    lcm = (a*b)//gcd
    print(lcm)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy

def euclidean_algorithm(a, b):
    if a < b:
        tmp = b
        b = a
        a = tmp

    ｑ = a // b
    r = a % b
    while r != 0:
        a = b
        b = q
        q = a // b
        r = a % b
    
    return b


def main():
    a, b = map(int, input().split())

    # print(numpy.lcm(a, b)) # AtCoderでは使用不可

    #ユークリッド互除法(最大公約数)
    gcd = euclidean_algorithm(a, b)
 
    # 最小公倍数
    lcm = (a*b)//gcd
    print(lcm)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def euclidean_algorithm(a, b):
    if a < b:
        tmp = b
        b = a
        a = tmp

    ｑ = a // b
    r = a % b
    while r != 0:
        a = b
        b = q
        q = a // b
        r = a % b
    
    return b


def main():
    a, b = map(int, input().split())

    #ユークリッド互除法(最大公約数)
    gcd = euclidean_algorithm(a, b)
    print(2)

    # 最小公倍数
    lcm = (a*b)//gcd
    print(lcm)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy

def main():
    a, b = map(int, input().split())

    print(numpy.lcm(a, b))

if __name__ == "__main__":
    main()
Problem p02699 (python)

Fixed submission:
n, a = (int(x) for x in input().split())
if n <= a:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
n, a, b, c = (int(x) for x in input().split())
while n > 0 and b > 0:
    n -= c
    if n < 0:
        print("No")
        break
    b -= a
    if b < 0:
        print("Yes")
        break
Problem p02711 (python)

Fixed submission:
n=input()
n=str(n)
t='nd'
for i in n:
    if i=='7':
        print('Yes')
        t='d'
        break
if t=='nd':print('No')

Buggy submission (verdict: Runtime Error):
n=input()
n=str(n)
t='nd'
for i in n;
	if i=='7':
    	print('Yes')
      	t='d'
if t=='nd':print('No')

Buggy submission (verdict: Runtime Error):
n=str(input())
t='nt'
for(i in range(n)):
  if(n[i]=='7'):
    print("Yes")
    t='tr'
if(t='nt'):
  print("No")
Problem p02759 (python)

Fixed submission:

N=int(input())

if N%2==0 :
    print(N//2)
else :
    print(N//2+1)

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

if N%2==0 :
    print(N/2)
else :
    print(N//2+1)
Problem p02785 (python)

Fixed submission:
from collections import deque

N,K=map(int,input().split())

A=list(map(int,input().split()))
A.sort(reverse=True)
A=A[K:]

print(sum(A))

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

A=list(map(int,input().split()))
A.sort(reverse=True)

for _ in range(K):
    A.pop(0)


print(sum(A))