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

Fixed submission:
n = int(input())
for i in range(1,12):
    if n <= pow(26,i):
        d = i
        break
    n = n - pow(26,i)
d = d - 1 
n = n - 1
ans =''
for i in range(d):
    tmp = divmod(n,pow(26,d-i))
    ans = ans+ chr(97+tmp[0])
    n = tmp[1]
print(ans + chr(97+n))

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1,11):
    if n <= pow(26,i):
        d = i
        break
    n = n - pow(26,i)
d = d - 1 
n = n - 1
ans =''
for i in range(d):
    tmp = divmod(n,pow(26,d-i))
    ans = ans+ chr(97+tmp[0])
    n = tmp[1]
print(ans + chr(97+n))
Problem p02659 (python)

Fixed submission:
from decimal import *
getcontext().prec = 18
x = input().split()

aa = Decimal(x[0])*Decimal(x[1])

print(int(aa))

Buggy submission (verdict: Runtime Error):
x = input().split()
a = float(x[0])
b = float(x[1]))
ans = int(a*b)
print(ans)
Problem p02570 (python)

Fixed submission:
D, T, S =map(int, input().split())
if T >= D/S:
    print ("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
T = str(input())
ans = 10000
for i in range(len(S)-len(T)+1):
    c = S[i:] 
    cnt = 0
    for j in range(len(T)):
        if str(T[j]) != str(c[j]):
            cnt += 1
    if cnt = 0:
        ans = 0
    elif  ans > cnt and cnt >=1:
        ans = cnt
print (ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
T = str(input())
ans = 10000
for i in range(len(S)-len(T)+1):
    c = S[i:] 
    cnt = 0
    for j in range(len(T)):
        if str(T[j]) != str(c[j]):
            cnt += 1
    if cnt = 0:
        ans = 0
    if  ans > cnt and cnt >=1:
        ans = cnt
print (ans)
Problem p02595 (python)

Fixed submission:
#B-distance
N, D = map(int, input().split())
count = 0

for i in range(N):
    x, y = map(int, input().split())
    if (x*x + y*y <= D*D):
        count += 1
print (count)

Buggy submission (verdict: Runtime Error):
N,D=input().split() 
N=int(N)
D=int(D)
count = 0

list = []
for i in range(N):
    a, b=input().split()
    list.append((int(a),int(b)))

for n in range(N):
    distance=((list[u][0]) ** 2 + (list[u][1]) ** 2)
    if distance <= D:
        count += 1

print (count)
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
times_a = list(map(int, input().split()))
times_b = list(map(int, input().split()))
read_time = 0
read_time_a = [0]
read_time_b = [0]
for i in range(N):
    read_time_a.append(read_time_a[i]+times_a[i])
for i in range(M):
    read_time_b.append(read_time_b[i]+times_b[i])

ans = 0
for i in range(N+1):
    t = read_time_a[i]
    l = 0
    r = len(read_time_b)
    while l + 1 < r:
        c = (l + r) // 2
        if t + read_time_b[c] <= K:
            l = c
        else:
            r = c
    if read_time_a[i] + read_time_b[l] <= K:
        ans = max(ans, i + l)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
times_a = list(map(int, input().split()))
times_b = list(map(int, input().split()))
read_time = 0
read_time_a = [0]
read_time_b = [0]
for i in range(len(times_a)):
    read_time_a.append(read_time_a[i]+times_a[i])
for i in range(len(times_b)):
    read_time_b.append(read_time_b[i]+times_b[i])
count = 0
for i in range(N+1):
    t = read_time_a[i]
    l = 0
    r = len(read_time_b)
    while l + 1 < r:
        c = (l + r) // 2
        if t + read_time_b[c] <= K:
            l = c
        else:
            r = c
    if read_time_a[i] + read_time_b[l] <= K:
        ans = max(ans, i + l)
print(ans)
Problem p02629 (python)

Fixed submission:
n = int(input())

ans = ""

al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

while n > 0:
    tmp = n % 26
    if tmp > 0:
        ans += al[tmp-1]
    else:
        ans += 'z'
        n = n - 1
    n = n // 26

print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())

ans = ""

al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

while n > 0:
    tmp = n % 26
    if tmp > 0:
        ans += al[tmp-1]
    else:
        ans += 'z'
        n -= 1
    n /= 26
    if n == 0:
        break

print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())

ans = ""

while(n > 0):
    tmp = n % 26
    if tmp > 0:
        ans += chr((tmp - 1) + ord('a'))
    else:
        ans += 'z'
        n -= 1
    n /= 26
    if n == 0:
        break

print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())

ans = ""

while(n > 0):
    tmp = n % 26
    if tmp > 0:
        ans += chr((tmp - 1) + ord('a'))
    else:
        ans += 'z'
        n -= 1
    n /= 26

print(ans[::-1])
Problem p02580 (python)

Fixed submission:
from collections import defaultdict
h,w,m = map(int,input().split())
dh = defaultdict(int)
dw = defaultdict(int)
l=defaultdict(tuple)
for _ in range(m):
    x,y = map(int,input().split())
    dh[x]+=1
    dw[y]+=1
    l[(x,y)]=1
m = 0
for i in range(1,h+1):
    if dh[i]>m:
        m = dh[i]
        hi=i
c=m
m = 0
for i in range(1,w+1):
    d = dw[i]
    if l[(hi,i)]==1:
        d-=1
    m = max(m,d)
c+=m
m = 0
wi=0
for i in range(1,w+1):
    if dw[i]>m:
        m = dw[i]
        wi=i
c2=m
m = 0
for i in range(1,h+1):
    d = dh[i]
    if l[(i,wi)]==1:
        d-=1
    m = max(m,d)
c2+=m
print(max(c,c2))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
h,w,m = map(int,input().split())
dh = defaultdict(int)
dw = defaultdict(int)
for _ in range(m):
    x,y = map(int,input().split())
    dh[x]+=1
    dw[y]+=1
    l.append((x,y))
m=0
hi=0
for i in dh:
    if dh[i]>m:
        m=dh[i]
        hi=i
c=m
m=0
for i in dw:
    if dw[i]>m:
        m=dw[i]
        if (hi,i) in l:
            m-=1
c+=m
print(c)
Problem p02624 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    m=n//i #　iを約数にもつ数の個数
    j=(1+m)*m//2 
    ans+=j*i
    
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
n=int(input())
ans=0
for i in range(1,n+1):
    ans+=i*sympy.divisor_count(i)
    

print(ans)
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
x=n//(a+b)
y=n%(a+b)
z=min(a,y)
print(a*x+z)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
x=n//(a+b)+1

ans=""
i=1
while i<=x:
    ans=ans+"A"*a+"B"*b
    i+=1
#ans2=[ans]
ans2=ans[:n]
print(ans2.count("A"))
Problem p02831 (python)

Fixed submission:
import fractions
 
a,b=map(int,input().split())
print(int((a * b /fractions.gcd(a, b))))

Buggy submission (verdict: Runtime Error):
import fractions

a,b=map(int,input().split())
print(int((a * b /fraction.gcd(a, b))))

Buggy submission (verdict: Runtime Error):
import fraction

a,b=map(int,input().split())
print(int((a * b /fraction.gcd(a, b))))

Buggy submission (verdict: Runtime Error):
import math

a,b=map(int,input().split())
print(int((a * b /math.gcd(a, b))))
Problem p02832 (python)

Fixed submission:
n=int(input())
 
l=list(map(int,input().split()))
cnt=0
for i in range(n):
	if l[i]==cnt+1:
	    cnt+=1
      
if cnt==0:
  	print(-1)
else:
  print(n-cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())

l=list(map(int,input().split()))
cnt=0
for i in range(n):
	if l[i]==cnt+1:
      cnt+=1
      
if cnt==0:
  	print(-1)
else:
  print(n-cnt)
Problem p02881 (python)

Fixed submission:
n=int(input())
ans=[]

nr=int(n**0.5)


for i in range(1,nr+1):
    if n%i==0:
        ans.append(i+n//i)
   
ans2=sorted(ans)
print(ans2[0]-2)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=[]

nr=int(n**0.5)


for i in range(1,nr):
    if n%i==0:
        ans.append(i+n//i)
   
ans2=sorted(ans)
print(ans2[0]-2)
Problem p02951 (python)

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

if a-b>=c:
    print(0)
else:
    print(c-(a-b))

Buggy submission (verdict: Runtime Error):
n=input()
x=len(n)
if x==1:
    print(n)

elif x<3:
    print(9)
elif x==3:
    print(9+int(n)-100+1)
elif x<5:
    print(909)
elif x==5:
    print(9+900+int(n)-10000+1)
else:
    print(90909)
Problem p03135 (python)

Fixed submission:
a,b=map(float,input().split())
print(a/b)

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

ps=sorted(int(i) for i in input().split())

if n>=m:
    print(0)
    exit()

dis2=sorted(ps[i+1]-ps[i] for i in range(m-1))


print(sum(dis2[:m-n]))
Problem p02912 (python)

Fixed submission:
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x * (-1), a))
heapq.heapify(a)
for _ in range(m):
    min = ((heapq.heappop(a) * (-1)) // 2) * (-1)
    heapq.heappush(a, min)
print(sum(a)*(-1))

Buggy submission (verdict: Runtime Error):
import heapq
n, m = map(int, input().split())
a = list(map(lambda x: int(x) * (-1), a))
heapq.heapify(a)
for _ in range(m):
    min = ((heapq.heappop(a) * (-1)) // 2) * (-1)
    heapq.heappush(a, min)
print(sum(a)*(-1))
Problem p02935 (python)

Fixed submission:
N = int(input())
v = list(map(int, input().split()))
 
 
v.sort(reverse = True)
 
for i in range(N-1):
    a = v.pop()
    b = v.pop()
    v.append((a+b)/2)
    v.sort(reverse = True)
 
print(v[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
v_list = list(map(int, input().split()))
while len(v_list) != 1:
    sort(v_list)
    a = v_list.pop()
    b = v_list.pop()
    v_list.append((a + b) / 2)
print(v_list[0])
Problem p02725 (python)

Fixed submission:
K,N = map(int,input().split())
A = list(map(int,input().split()))
    
max = K-A[-1]+A[0]
 
for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]
    
print(K-max)

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

A = list(range(N))

for i in range(N):
    A[i]=int(input())
    
max = 0

for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

if max < K-A[N-1]+A[0]:
    max = K-A[N-1]+A[0]
    
print(K-max)

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

A = list(range(N))

for i in range(N):
    A[i]=int(input())
    
max = A[0]

for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

if max < K-A[N-1]+A[0]:
    max = K-A[N-1]+A[0]
    
print(K-max)

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

A = list(range(N))

for i in range(N):
    A[i]=int(input())
    
max = A[0]

for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

if max < K-A[N-1]+A[0]:
    max = K-A[N-1]+A[0]
    
print(K-max)

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

A = [0]

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

for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

if max < K-A[N-1]+A[0]:
    max = K-A[N-1]+A[0]
    
print(K-max)

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

A = []

for i in range(N):
    A.append(int(input()))
    
max = A[0]
memo = 0

for i in range(N-1):
    if max < A[i+1]-A[i]:
        max = A[i+1]-A[i]

if max < K-A[N-1]+A[0]:
    max = K-A[N-1]+A[0]
    
print(K-max)
Problem p02831 (python)

Fixed submission:
from fractions import gcd

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

print(A * B // gcd(A, B))

Buggy submission (verdict: Runtime Error):
import math

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

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

Buggy submission (verdict: Runtime Error):
import math

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

A, B = list(map(int, input().split()))
print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = list(map(int, input().split()))
print(A * B // math.gcd(A, B))
Problem p02729 (python)

Fixed submission:
def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
a,b=map(int, input().split())
cnt=0
if a==2:
    cnt=1
elif a>1:
    cnt=(factorial(a)/((factorial(a-2))*2))
if b==2:
    cnt=cnt+1
elif b>1:
    cnt=(factorial(b)/((factorial(b-2))*2))+cnt
print(int(cnt))

Buggy submission (verdict: Runtime Error):
def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
a,b=map(int, input().split())
cnt=0
if a>1:
    cnt=(factorial(a)/((factorial(a-2))*2))
if b>1:
    cnt=(factorial(b)/((factorial(b-2))*2))+cnt
print(int(cnt))

Buggy submission (verdict: Runtime Error):
def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
a,b=map(int, input().split())
cnt=0
if a>0:
    cnt=(factorial(a)/((factorial(a-2))*2))
if b>0:
    cnt=(factorial(b)/((factorial(b-2))*2))+cnt
print(int(cnt))
Problem p02759 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a=int(input())
b=int((a+1)/2)
print(b)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int2((a+1)/2)
print(b)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int2((a+1)/2)
print(b)
Problem p02987 (python)

Fixed submission:
a = input()
b = list(set(list(a)))
print('Yes' if len(b) == 2 and a.count(b[0]) == 2 and a.count(b[1]) == 2 else 'No')

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

c = 0
for i in range(1, n):
  if sorted([ns[i-1], ns[i], ns[i+1]])[2] == ns[i]:
    c += 1
    
print(c)
Problem p03072 (python)

Fixed submission:
N = int(input())
Hs = list(map(int, input().split()))
print(len([i for i in range(0, len(Hs)) if all([Hs[j] <= Hs[i] for j in range(0, i)])]))

Buggy submission (verdict: Runtime Error):
N = int(input())
Hs = list(map(int, input().split()))
print(len([i for i in range(0, len(Hs)) if all(lambda j: Hs[j]<=Hs[j+1]), range(0, i)]))
Problem p03307 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(int(input()), 2))

Buggy submission (verdict: Runtime Error):
import fraction
def lcm(x, y):
    return (x * y) // fraction.gcd(x, y)

print(lcm(int(input()), 2))

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(int(input()), 2))
Problem p03803 (python)

Fixed submission:
power = [i for i in range(2, 13+1)] + [1]
A, B = map(lambda x: power.index(int(x)), input().split())
if A < B:
  print('Bob')
elif A == B:
  print('Draw')
else:
  print('Alice')

Buggy submission (verdict: Runtime Error):
power = [i for i in range(2, 12+1)] + [1]
A, B = map(lambda x: power.index(int(x)), input().split())
if A < B:
  print('Bob')
elif A == B:
  print('Draw')
else:
  print('Alice')

Buggy submission (verdict: Runtime Error):
power = [i for i in range(1, 12+1)] + [2]
A, B = map(lambda x: power.index(int(x)), input().split())
if A < B:
  print('Bob')
elif A == B:
  print('Draw')
else:
  print('Alice')
Problem p02819 (python)

Fixed submission:
import math
def isPrime(n):
    if n < 2:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
    # ２ではない偶数は素数ではない
        return False
  
  # nの半分まで計算する範囲を絞る
    m = math.floor(n / 2) + 1
    for p in range(3, m, 2): # 奇数だけ計算する
        if n % p == 0:
            return False
    return True
# def isPrime(n):
#     if n < 2:
#     # 2未満は素数でない
#         return False
#     if n == 2:
#     # 2は素数
#         return True
#     for p in range(2, n):
#         if n % p == 0:
#         # nまでの数で割り切れたら素数ではない
#             return False
#   # nまでの数で割り切れなかったら素数
#     return True
X = int(input())
ans = 0
for i in range(X, 10 ** 10):
    if isPrime(i):
        ans = i
        break

print(ans)

Buggy submission (verdict: Runtime Error):
from sympy import isprime
X = int(input())
ans = 0
for i in range(X, 10 ** 5 + 1):
    if isprime(i):
        ans = i
        break

print(i)
Problem p03834 (python)

Fixed submission:
print(input().replace(',', ' '))

Buggy submission (verdict: Runtime Error):
print(str(input().split(',',' ')))
Problem p02597 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
s = readline().decode().rstrip()

w = s.count('W')
r = s.count('R')
if r == 0 or w == 0:
    print(0)
    exit()
i_r = s.index('R')
r2 = s[:r:].count('R')
print(r-r2)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
s = readline().decode().rstrip()

w = s.count('W')
r = s.count('R')
i_r = s.index('R')
r2 = s[:r:].count('R')
# print(w, r, i_r)
print(r-r2)
Problem p02689 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


n, m = map(int, readline().split())
h = list(map(int, readline().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
l = [1]*n
for i in range(m):
    if h[ab[i][0] - 1] < h[ab[i][1] - 1]:
        l[ab[i][0] - 1] = 0
    elif h[ab[i][0] - 1] > h[ab[i][1] - 1]:
        l[ab[i][1] - 1] = 0
    else:
        l[ab[i][0] - 1] = 0
        l[ab[i][1] - 1] = 0
print(sum(l))

Buggy submission (verdict: Runtime Error):
n, m = map(int, readline().split())
h = list(map(int, readline().split()))

l = [1]*n
for i in range(m):
    a, b= map(int, readline().split())
    if h[a - 1] < h[b - 1]:
        l[a - 1] = 0
    elif h[a - 1] > h[b - 1]:
        l[b - 1] = 0
    else:
        l[a - 1] = 0
        l[b - 1] = 0
print(sum(l))
Problem p03307 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
	print(n)
else:
  	print(n*2)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted(map(int,input().split()))
print(a[n-1]-a[0])
Problem p03803 (python)

Fixed submission:
A, B = map(int, input().split())
if A == B:
    ans = 'Draw'
elif A == 1:
    ans = 'Alice'
elif B == 1:
    ans = 'Bob'
elif A > B:
    ans = 'Alice'
else:
    ans = 'Bob'
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input() for i in range(N)]
B = [input() for j in range(M)]

ans = True
for k in range(len(B)):
    if B[k] not in A[k]:
        ans = False
        break
print("Yes" if ans == True else "No")
Problem p03804 (python)

Fixed submission:
N, M = map(int, input().split())
A = [input() for i in range(N)]
B = [input() for j in range(M)]

ans = True
for k in range(len(B)):
    if B[k] not in A[k]:
        ans = False
        break
print("Yes" if ans == True else "No")

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input() for i in range(N)]
B = [input() for i in range(M)]

ans = 'No'
for i in range(N):
    if A[i].find(B[0]) > -1:
        x = A[i].find(B[0])
        y = i + 1
        ans = 'Yes'
        break
for j in range(1, M):
    if B[j] != A[y][x:M]:
        ans = 'No'
print(ans)
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
arr_a = list(map(int, input().split()))
arr_b = list(map(int, input().split()))
ans_a =0
ans_b =0
time =0

for i in range(N):
    if time + arr_a[i] > K:
        break
    else:
        ans_a +=1
        time += arr_a[i]
for i in range(M):
    if time + arr_b[i] > K:
        break
    else:
        ans_b +=1
        time += arr_b[i]

ans = ans_a + ans_b
ans_koho = ans_a + ans_b
cnt_b = ans_b

for i in range(ans_a):
    ans_koho -= 1
    time -= arr_a[ans_a-i-1]

    while True:
        if cnt_b == M:
            break
        elif time + arr_b[cnt_b] > K:
            break
        else:
            time += arr_b[cnt_b]
            cnt_b += 1
            ans_koho += 1
    ans = max(ans, ans_koho)

print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
arr_a = list(map(int, input().split()))
arr_b = list(map(int, input().split()))
ans_a =0
ans_b =0
time =0

for i in range(N):
    if time + arr_a[i] > K:
        break
    else:
        ans_a +=1
        time += arr_a[i]
for i in range(M):
    if time + arr_b[i] > K:
        break
    else:
        ans_b +=1
        time += arr_b[i]

ans = ans_a + ans_b
ans_koho = ans_a + ans_b
cnt_b = ans_b

for i in range(ans_a):
    ans_koho -= 1
    time -= arr_a[-1*(i+1)]

    while True:
        if cnt_b == M:
            break
        elif time + arr_b[cnt_b] > K:
            break
        else:
            time += B[cnt_b]
            cnt_b += 1
            ans_koho += 1
    ans = max(ans, ans_koho)

print(ans)
Problem p02831 (python)

Fixed submission:
import fractions
X, Y = map(int, input().split())

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

print(lcm(X,Y))

Buggy submission (verdict: Runtime Error):
import math
X, Y = map(int, input().split())

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

print(lcm(X,Y))
Problem p02847 (python)

Fixed submission:
S = input()
arr =['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7-arr.index(S))

Buggy submission (verdict: Runtime Error):
S = input()
arr =['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(arr[arr.index(S)+1])

Buggy submission (verdict: Runtime Error):
S = input()
arr =['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(arr[arr.index(S)+1])
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N = int(input())

List = []
for i in range(1,10**4):
    for j in range(1,10**4):
        if N == i*j:
            List.append(i+j)

print(min(List)-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27,30,32,35,36,40,42,45,48,49,54,56,63,64,72,81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9,10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9,10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40,42,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9,10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40,42,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9,10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40,42,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9, 10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N in [1, 2, 3, 4, 5, 6, 7 ,8 ,9, 10, 12, 14, 15, 16, 18, 20, 21 ,24, 25, 27, 30, 32, 35, 36, 40, 42,45, 48, 49, 54, 56, 63, 64 ,72, 81]):
    print("Yes")
else:
    print("No")
Problem p02881 (python)

Fixed submission:
#--------------------------------------------
#ライブラリ等
import sys
import math
from math import sqrt
input = sys.stdin.readline

#---------------------------------------------
N = int(input())
for i in range(int(sqrt(N))+1,-1,-1):
    if N % i == 0:
        print(int(i+(N/i)-2))
        exit()

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

List = []
for i in range(1,10*5):
    for j in range(1,10**5):
        if N == i*j:
            List.append(i+j)

print(min(List)-2)
Problem p02987 (python)

Fixed submission:
N=input()
A=len(set(N))
if A==2 and N.count(N[0]) == N.count(N[1]) == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=input()
A=len(set(N))
if A==2 and N.count(A[0]) == N.count(A[1]) == 2:
    print("Yes")
else:
    print("No")