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

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
#import numpy as np
#N = map(int, input().split())
N = int(input())
h = list(map(int,input().split()))

# メモ化再帰
#memo = np.full(N, -1)
memo = [-1]*N
def func(i):
    if memo[i] != -1:
        return memo[i]
    if i == 0:
        return 0
    elif i == 1:
        return abs(h[1]-h[0])
    a = func(i-1) + abs(h[i]-h[i-1])
    b = func(i-2) + abs(h[i]-h[i-2])
    memo[i] = min(a,b)
    return min(a,b)
print(func(N-1))

# pythonの問題はfuncの呼び出し回数
# 10^50に耐えられない
# sys.setrecursionlimit(10**6)で回避可能

Buggy submission (verdict: Runtime Error):
#import numpy as np
#N = map(int, input().split())
N = int(input())
h = list(map(int,input().split()))

# DP問題はメモ化再帰
#memo = np.full(N, -1)
memo = [-1]*N
def func(i):
    if memo[i] != -1:
        return memo[i]
    if i == 0:
        return 0
    elif i == 1:
        return abs(h[1]-h[0])
    a = func(i-1) + abs(h[i]-h[i-1])
    b = func(i-2) + abs(h[i]-h[i-2])
    memo[i] = min(a,b)
    return min(a,b)
print(func(N-1))
Problem p02658 (python)

Fixed submission:
n = int(input())
ans = 1
flg = True
input_a = list(input().split())

if '0' in input_a:
    print(0)
else:
    for a in input_a:
        _a = int(a)
        ans *= _a
        if ans > 10 ** 18:
            print(-1)
            flg = False
            break

    if flg:
        print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 1
flg = True

if '0' in list(input().split()):
    print(0)
else:
    for a in input().split():
        _a = int(a)
        ans *= _a
        if ans > 10 ** 18:
            print(-1)
            flg = False
            break

    if flg:
        print(ans)
Problem p02690 (python)

Fixed submission:
x = int(input())


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


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


p = factorization(x)
p = make_divisors(x)
# print(p)
Bas = 0
Aas = 0

flg = False
# p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

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


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


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    flg = 0
    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            break
        if xnew > x:
            if flg == -1:
                B *= 10
                B = min(-_p/2, B)
            else:
                B -= 1
            flg = -1
        else:
            if flg == 1:
                B *= 10
            else:
                B += 1
            flg = 1

print(f'{Aas} {Bas}')
Problem p02702 (python)

Fixed submission:
import math
s = input()
n = len(s)
count = 0
a = [0 for i in range(2019)]
a[0] = 1
k = 0
b = [0 for i in range(n)]
b[0] = 1
for i in range(1, n):
    b[i] = b[i-1]*10 % 2019

#print(b)
for i in reversed(range(0, n)):
 #   print((b[n-i-1])*int(s[i]) % 2019)
    k += (b[n-i-1])*int(s[i]) % 2019
  #  print(k, k % 2019)
    a[k % 2019] += 1

for i in range(len(a)):
    if a[i] >= 2:
        count += (a[i])*(a[i]-1)//2
print(count)

Buggy submission (verdict: Runtime Error):
for i in range(100):
    t = i * 2019
    if t > 200000:
        break
    for i in range(len(str(s))):
        for j in range(i+1, len(str(s))+1):
            tmp = s[i:j]
            if int(tmp) == t:
                c += 1


print(c)
Problem p03085 (python)

Fixed submission:
if __name__ == '__main__':
  V = input()
  
  if V == "T":
  	print("A")
  
  if V == "A":
    print("T")
  
  if V == "C":
    print("G")
  
  if V == "G":
    print("C")

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

if in == "T":
  return "A"
if in == "A":
  return "T"
if in == "C":
  return "G"
if in == "G":
  return "C"
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())  # 入力

ans1 = a + b
ans2 = a - b
ans3 = a * b

print(max(ans1,ans2,ans3))

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

# print(N, S)
ans = N

for i, h in enumerate(range(N)):
    skipflg = False
    f = S[0: i]
    l = S[i]
    s = S[i+1:]
    # print(f, l, s)
    nw = 0
    ne = 0
    nw = f.count('W')
    ne = s.count('E')
    # print(nw, ne)
    # for r in f:
    #     if r != 'E':
    #         nw += 1
    #         if nw >= ans:
    #             skipflg = True
    #             break
    #         # print('not e')

    # if skipflg:
    #     break

    # for w in s:
    #     if w != 'W':
    #         ne += 1
    #         if nw+ne >= ans:
    #             skipflg = True
    #             break
    #         # print('not w')

    # if skipflg:
    #     break

    ans = min(ans, nw+ne)

print(ans)

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

# print(N, S)
ans = N

for i, h in enumerate(range(N)):
    skipflg = False
    f = S[0: i]
    l = S[i]
    s = S[i+1:]
    print(f, l, s)
    nw = 0
    ne = 0
    nw = f.count('W')
    ne = s.count('E')
    print(nw, ne)
    # for r in f:
    #     if r != 'E':
    #         nw += 1
    #         if nw >= ans:
    #             skipflg = True
    #             break
    #         # print('not e')

    # if skipflg:
    #     break

    # for w in s:
    #     if w != 'W':
    #         ne += 1
    #         if nw+ne >= ans:
    #             skipflg = True
    #             break
    #         # print('not w')

    # if skipflg:
    #     break

    ans = min(ans, nw+ne)

print(ans)
Problem p03339 (python)

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

# print(N, S)
ans = N

f = S[0]
s = S[1:]

nw = 0
ne = 0

for w in s:
    if w != 'W':
        ne += 1

ans = nw+ne
for i in range(1, N):
    # skipflg = False
    # f = S[0: i]
    # l = S[i]
    # s = S[i+1:]
    # # print(i, f, l, s)
    # nw = f.count('W')
    # ne = s.count('E')
    # print(nw, ne)

    if S[i-1] != 'E':
        nw += 1

    if S[i] != 'W':
        ne -= 1
    # print(nw, ne)
    ans = min(ans, nw+ne)

print(ans)

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

# print(N, S)
ans = N

for i, h in enumerate(range(N)):
    skipflg = False
    f = S[0: i]
    l = S[i]
    s = S[i+1:]
    print(f, l, s)
    nw = 0
    ne = 0
    nw = f.count('W')
    ne = s.count('E')
    print(nw, ne)
    # for r in f:
    #     if r != 'E':
    #         nw += 1
    #         if nw >= ans:
    #             skipflg = True
    #             break
    #         # print('not e')

    # if skipflg:
    #     break

    # for w in s:
    #     if w != 'W':
    #         ne += 1
    #         if nw+ne >= ans:
    #             skipflg = True
    #             break
    #         # print('not w')

    # if skipflg:
    #     break

    ans = min(ans, nw+ne)

print(ans)
Problem p03352 (python)

Fixed submission:
x = int(input())
max1 = 1
for s in range(x):
  for t in range(2,10):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)

Buggy submission (verdict: Runtime Error):
x = input()
max1 = 1
for s in range(x):
  for t in range(x):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)

Buggy submission (verdict: Runtime Error):
x = map(int, input().split())
max1 = 1
for s in range(x):
  for t in range(x):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)

Buggy submission (verdict: Runtime Error):
x = map(int, input().split())
max1 = 1
for s in range(100):
  for t in range(100):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)

Buggy submission (verdict: Runtime Error):
x = map(int, input().split())
max1 = 1
for s in range(100):
  for t in range(100):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
    


print(max1)
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())  # 入力
if a <=  b:
    print(a)
if b < a:
    print(a-1)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())  # 入力
k = int(input())  # 入力
num_ary = [a, b, c]
max_n = max(num_ary)

max_index = num_ary.index(max_n)#最大値のindex

max_num = max_n * pow(2, k)

num_ary[max_index] = max_num

print(num_ary[0] + num_ary[1] + num_ary[2])
Problem p03360 (python)

Fixed submission:
a, b, c = map(int, input().split())  # 入力
k = int(input())  # 入力
num_ary = [a, b, c]
max_n = max(num_ary)

max_index = num_ary.index(max_n)#最大値のindex

max_num = max_n * pow(2, k)

num_ary[max_index] = max_num

print(num_ary[0] + num_ary[1] + num_ary[2])

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())  # 入力
k = map(int, input().split())  # 入力
num_ary = [a, b, c]
max_n = max(a,b,c)
max_index = num_ary.index(max_n)#最大値のindex
max_num = pow(max(a, b, c), k)

num_ary[max_index] = max_num

print(num_ary[0] + num_ary[1] + num_ary[2])
Problem p02760 (python)

Fixed submission:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0

if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[2]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0

if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[3]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]):
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")
Problem p02854 (python)

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

x = n//2
if sum(a)/2 == sum(a[:(n//2)]):
  print(0)
elif sum(a)/2 >= sum(a[:(n//2)]):
  while sum(a)/2 >= sum(a[:x]):
    x += 1  
  print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a))))
else:
  while sum(a)/2 <= sum(a[:x]):
    x -= 1
  print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x+1])-sum(a))))

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

if sum(a)/2 == sum(a[:(n//2)]):
  print(0)
elif sum(a)/2 >= sum(a[:(n//2)]):
  x = n//2
  while sum(a)/2 >= sum(a[:x]):
    x += 1  
  print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a))))
else:
  while sum(a)/2 <= sum(a[:x]):
    x -= 1
  print(min(abs(2*sum(a[:x])-sum(a)), abs(2*sum(a[:x-1])-sum(a))))

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

for i in range(n):
  if sum(a)/2 <= sum(a[:i]):
    x = i
    break
    
print(sum(a[:x])*2 - sum(a))
Problem p03971 (python)

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

i = 0
j = 0
for n in s:
  if n == "a":
    if i + j < a + b:
      i += 1
      print("Yes")
    else:
      print("No")
  elif n == "b":
    if (i + j < a + b) and j < b:
      j += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
j = 0
for n in s:
  if n == "a":
    if i + j < a + b:
      i += 1
      print("Yes")
    else:
      print("No")
  elif n == "b":
    if (i + j < a + b) and j < b:
      j += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")
Problem p02658 (python)

Fixed submission:
# %%
def main():
    N = input()
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            print(-1)
            return
    print(ans)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n = input()
num = list(map(int,input().split()))
for l in range(n):
    ans *= num[l] 
    if ans >= 10**18:
        print(-1)
        return
print(ans)

Buggy submission (verdict: Runtime Error):
num = list(map(int,input().split()))
for l in range(len(num)):
    ans *= num[l] 
if ans < 10**18:
    print(ans)
elif ans >= 10**18:
    print(-1)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if t.startswith(s) == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
s = 0
if  a + b >= k:
    s = a
else:
    s = a - (c - b) 
print(s)
Problem p02687 (python)

Fixed submission:
S = input()
if S == 'ABC':
    print("ARC")
elif S == 'ARC':
    print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()
if s == 'ABC':
    print("ARC")
elif s == 'ARC':
    print('ABC')

Buggy submission (verdict: Runtime Error):
x,y = map(int, input().split())
count = 0

if y >= 2*x and y <= 4*x and y % 2 == 0:
    print('Yes')
else:
    print('No')
Problem p02760 (python)

Fixed submission:
# ABC157 B
import numpy as np
a = [[input().split() for l in range(3)]]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'

def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[i*3:(i*3)+3],b) or check(a[i:i+7:3],b) or check(a[0:9:4],b) or check(a[2:7:2],b):
        ans = 'Yes'

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]

ans = 'No'
def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[i*3:i*3+2],b) or check(a[i:i+6:3],b) or check(a[0:8:4],b) or check(a[2:6:2],b):
        ans = 'Yes'

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]

ans = 'No'
def check(a,b):
    return set(a).issubset(b)

for i in range(3):
    if check(a[j*3:j*3+2],b) or check(a[j:j+6:3],b) or check(a[0:8:4],b) or check(a[2:6:2],b):
        ans = 'Yes'

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'
for i in b:
    for j in range(3):
        if i in a[j*3:j*3+2] or i in a[j:j+6:3]:
            ans = 'Yes'
if b in a[0:8:4] or b in a[2:6:2]:
    ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
# ABC157 B
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'Yes'
for i in range(3):
    if b not in a[i*3:i*3+2] or b not in a[i:i+6:3] or b not in a[0:8:4] or b not in a[2:6:2]:
        ans = 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'
for i in range(3):
    if b == a[i*3:i*3+2] or b == a[i:i+6:3] or b == a[0:8:4] or b == a[2:6:2]:
        ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a = [list(input()) for i in range(3)]
a = np.ravel(a)
n = int(input())
b = [input() for i in range(n)]
ans = 'No'
for i in range(3):
    if b in a[i*3:i*3+2] or b in a[i:i+6:3] or b in a[0:8:4] or b in a[2:6:2]:
        ans = 'Yes'
print(ans)
Problem p02765 (python)

Fixed submission:
N,R = map(int,input().split())
if N < 10:
  R = R + 100 * (10 - N)
  print(R)
else:
  print(R)

Buggy submission (verdict: Runtime Error):
N,R = map(int,input().split)
if N < 10:
  R = R - 100 * (10 - N)
  print(R)
else:
  print(R)

Buggy submission (verdict: Runtime Error):
N,R = map(int,input().split)
if N < 10:
  R = 100 * (10 - N)
  print(R)
else:
  print(R)

Buggy submission (verdict: Runtime Error):
N,R = map(int,input())
if N < 10:
  R = 100 * (10 - N)
  print(R)
else:
  print(R)
Problem p03281 (python)

Fixed submission:
N = int(input())
l = [105, 135, 165, 189, 195]
for i in range(5):
    if N < l[i]:
        print(i)
        exit()
print(5)

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [105, 135, 165, 189, 195]
for i in range(5):
    if N < l[i]:
        print(i)
        exit(1)
print(5)
Problem p02900 (python)

Fixed submission:
from fractions import gcd
from math import sqrt, ceil

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

count = 1
for i in range(2, ceil(sqrt(gcd_)) + 1):
    if gcd_ % i == 0:
        count += 1
        while gcd_ % i == 0:
            gcd_ /= i

if gcd_ != 1:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
from math import gcd, sqrt
import re


def int_check(n):
    n_type = type(n)
    if n_type != int:
        n_type_str = re.search(r'\'.+\'', str(n_type)).group()
        raise TypeError(n_type_str + ' object cannot be interpreted as an integer')


def eratosthenes(n):
    int_check(n)
    if n == 1:
        return []

    int_list = list(range(2, n+1))
    bottom_index = 0

    while int_list[bottom_index] <= sqrt(n):
        prime = int_list[bottom_index]
        bottom_index += 1
        top_index = bottom_index

        for num in int_list[bottom_index:]:
            if num % prime != 0:
                int_list[top_index] = num
                top_index += 1

        del int_list[top_index:]

    return int_list


def naive_method(n):
    int_check(n)
    if n == 1:
        return []

    prime_divisors = []
    for prime in eratosthenes(int(sqrt(n))):
        if n % prime == 0:
            remain_factor = n
            exponent = 0
            while remain_factor % prime == 0:
                remain_factor //= prime
                exponent += 1
            prime_divisors.append((prime, exponent))
            prime_divisors.extend(naive_method(remain_factor))

    prime_factors = []
    if len(prime_divisors) == 0:
        prime_factors.append((n, 1))
    else:
        prime_divisors.append((float('inf'), -float('inf')))
        prime_divisors.sort(key=lambda t: t[0])
        current_factor, max_exponent = prime_divisors[0]
        for factor in prime_divisors:
            if factor[0] == current_factor:
                max_exponent = max(max_exponent, factor[1])
            else:
                prime_factors.append((current_factor, max_exponent))
                current_factor, max_exponent = factor

    return prime_factors


def main():
    a, b = map(int, input().split())
    print(len(naive_method(gcd(a, b))) + 1)


if __name__ == '__main__':
    main()
Problem p03239 (python)

Fixed submission:
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print("TLE" if ans == 1005 else ans)

Buggy submission (verdict: Runtime Error):
N,T = map(int, input().split())
ans = 1005
for i in range(N):
    c,t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print("TLE" if m == 1005 else ans)
Problem p03456 (python)

Fixed submission:
a,b = input().split()
t = int(a+b)
flag = False
for i in range(t//2 + 1):
    if i**2 == t:
        flag = True
        break
if flag: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
a,b = input().split()
t = int(a+b)
print("Yes" if t == int(c**0.5)**2 else "No")
Problem p02675 (python)

Fixed submission:
n=input()

if int(n[-1])==2:
    print("hon")
elif int(n[-1])==4:
    print("hon")
elif int(n[-1])==5:
    print("hon")
elif int(n[-1])==7:
    print("hon")
elif int(n[-1])==9:
    print("hon")
elif int(n[-1])==0:
    print("pon")
elif int(n[-1])==1:
    print("pon")
elif int(n[-1])==6:
    print("pon")
elif int(n[-1])==8:
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
import math

a,b,h,m = map(int,input().split())

tan=h*30+0.5*m
cho=6*m

kakudo=float(100)

if math.sqrt((tan-cho)*(tan-cho))>180:
	kakudo=360-math.sqrt((tan-cho)*(tan-cho))
	print(math.sqrt(a*a+b*b-2*a*b*(math.cos(math.radians(kakudo)))))

if math.sqrt((tan-cho)*(tan-cho))==180:
	print(a+b)

if math.sqrt((tan-cho)*(tan-cho))<180:
	kakudo=math.sqrt((tan-cho)*(tan-cho))
	print(math.sqrt(a*a+b*b-2*a*b*(math.cos(math.radians(kakudo)))))

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

if len(s)<=k:
    print(s)
elif len(s)>k:
    print(s[0:k]+'...')
Problem p02681 (python)

Fixed submission:
s=str(input())
t=str(input())
if len(s)-len(t)==-1:
	if s==t[0:len(s)]:
		print("Yes")
	else:
		print("No")
else:
	print("No")

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

if k<=a:
	amount=k
	print(amount)
elif k<=a+b:
	amount=a
	print(amount)
else:
	amount=a+(-1)*(k-a-b)
	print(amount)
Problem p02690 (python)

Fixed submission:
x=int(input())
for i in range(-200,200):
      for j in range(-200,200):
        if i**5-j**5==x:
          print(str(i)+" "+str(j))
          exit()

Buggy submission (verdict: Runtime Error):
x=int(input()
for i in range(-200,200):
      for j in range(-200,200):
        if i**5-j**5==x:
          print(str(i)+" "+str(j)
          exit()
Problem p02696 (python)

Fixed submission:
a,b,n=map(int,input().split())
x = min(b-1,n)
print(int(a*x/b)-a*int(x/b))

Buggy submission (verdict: Runtime Error):
a,b,n=map(int,(inpur().split())
x = min(b-1,n)
print(int(a*x/b)-a*int(x/b))
Problem p02700 (python)

Fixed submission:
def main():

    a, b, c, d = map(int, input().split())

    while c > 0:
        c = c - b
        if c <= 0:
            print("Yes")
            return
        a = a - d
        if a <= 0:
            print("No")
            return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# a:高橋 体力
# b:高橋 攻撃力
# c:青木　体力
# d:青木　攻撃力

a,b,c,d = int(input().split())

while c > 0:
  c = c-b　#青木体力
  if c <= 0:
    print("Yes")
  a = a-d
  if a <= 0:
    print("No")

Buggy submission (verdict: Runtime Error):
# a:高橋 体力
# b:高橋 攻撃力
# c:青木　体力
# d:青木　攻撃力

a,b,c,d = map(int, input().split())

while c > 0:
  c = c-b　#青木体力
  if c <= 0:
    print("Yes")
  a = a-d
  if a <= 0:
    print("No")

Buggy submission (verdict: Runtime Error):
# a:高橋 体力
# b:高橋 攻撃力
# c:青木　体力
# d:青木　攻撃力

a,b,c,d = map(int, input().split())

while c > 0:
	c = c-b　#青木体力
	if c <= 0:
		print("Yes")
    a = a-d
    if a <= 0:
      	print("No")
Problem p02705 (python)

Fixed submission:
import math

r = input()
p = int(r)
pi_ = round(math.pi,4)
print(2*p*pi_)

Buggy submission (verdict: Runtime Error):
import math

r = input()
pi_ = round(math.pi,4)
print(2*r*pi_)

Buggy submission (verdict: Runtime Error):
import math

r = input()
print(2*r*math.pi)
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
a = int(input())
print(a*a**2*a***3)