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

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

if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a, b= map(int, [input() for i in range(2)])

if a<=8 and b=<8:
    print("Yay!")
else:
    print(":(")
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())
print('Yes' if K * 500 >= X else 'No')

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
permutation = list(itertools.permutations([x for x in range(1, N + 1)]))

a = permutation.index(P) + 1
b = permutation.index(Q) + 1
print(abs(a - b))
Problem p02844 (python)

Fixed submission:
N = int(input())
S = tuple(map(int, input()))

ans = 0

for i in range(10):
    if i in S[:N - 2]:
        i_index = S.index(i)
        for j in range(10):
            if j in S[i_index + 1: N - 1]:
                j_index = i_index + S[i_index + 1: N - 1].index(j) + 1
                for k in range(10):
                    if k in S[j_index + 1:]:
                        ans += 1
print(ans)

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

ans = 0

for i in range(1000):
    t = str(i).zfill(3)
    t_index = 0
    for s_index in range(N):
        if S[s_index] == t[t_index]:
            t_index += 1
            if t_index == 3:
                break
        if t_index == 3:
            ans += 1
print(ans)
Problem p03076 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
answer = 0
cooking_time_order = sorted([A, B, C, D, E], key=lambda x: 10 - (x % 10))
for _ in range(5):
    if cooking_time_order[-1] % 10 == 0:
        answer += cooking_time_order[-1]
        cooking_time_order.pop()
    else:
        break
if len(cooking_time_order) == 0:
    pass
else:
    for cooking_time in cooking_time_order[:-1]:
        answer += (cooking_time + (10 - (cooking_time % 10)))
    answer += (cooking_time_order[-1])
print(answer)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
answer = 0
cooking_time_order = sorted([A, B, C, D, E], key=lambda x: 10 - (x % 10))
for _ in range(5):
    if cooking_time_order[-1] % 10 == 0:
        answer += cooking_time_order[-1]
        cooking_time_order.pop()
    else:
        break
for cooking_time in cooking_time_order[:-1]:
    answer += (cooking_time + (10 - (cooking_time % 10)))
answer += (cooking_time_order[-1])
print(answer)
Problem p03239 (python)

Fixed submission:
N, T = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(N)]
cost = 2000000
TLE_flg = True
for i in range(N):
    if c_t[i][1] <= T:
        cost = min(cost, c_t[i][0])
        TLE_flg = False
print('TLE' if TLE_flg else cost)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
c_t = [list(map(int, input().split())) for _ in range(N)]
cost = 2_000_000
TLE_flg = True
for i in range(N):
    if c_t[i][1] <= T:
        cost = min(cost, c_t[i][0])
        TLE_flg = False
print('TLE' if TLE_flg else cost)

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
cost = 2_000_000
TLE_flg = True
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c)
        TLE_flg = False
print('TLE' if TLE_flg else cost)
Problem p03697 (python)

Fixed submission:
A, B = map(int, input().split())
if A + B >= 10:
    print('error')
else:
    print(A + B)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [int(input()) for _ in range(N)]
ans = sum(s)
if ans % 10 != 0:
    print(ans)
else:
    for s_i in s:
        if s_i % 10 != 0:
            ans -= s_i
            print(ans)
            break
    else:
        print(0)
Problem p04029 (python)

Fixed submission:
N = int(input())
result = N * (N + 1) // 2
print('{}'.format(result))

Buggy submission (verdict: Runtime Error):
N = int(input())
result = N * (N + 1) // 2
print(f'{result}')
Problem p02730 (python)

Fixed submission:
s = input()
n = len(s)
t = s[:n // 2]
k = s[-n//2+1:]
if s == s[::-1] and t == t[::-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
t = s[:n // 2]
k = s[-n//2+1:]
if s == s[::-1] and t == t[::-1]:
    print('Yes')
else:
    print('No')
s = input()
n = len(s)
t = s[:n // 2]
k = s[-n//2+1:]
if s == s[::-1] and t == t[::-1]:
    print('Yes')
else:
    print('No')
提出情報
Problem p02639 (python)

Fixed submission:
import numpy as np


def main(x):
    for i in range(len(x)):
        if x[i] == 0:
            return i+1
    return 1


x = list(map(int, input().split()))
print(main(x))

Buggy submission (verdict: Runtime Error):
def main(N, a):
    a.sort()
    if a[0] == 1:
        if a[1] == 1:
            return 0
        return 1
    i = 0
    while True:
        num = a[0]
        if 2 > len(a):
            return len(a)+i
        while True:
            if num == a[1]:
                a = [i for i in a if i != num]
                if 2 > len(a):
                    return len(a)+i
                num = a[0]
            else:
                break
        if num*2 > a[len(a)-1]:
            a = [i for i in a if i % num != 0]
            return len(a)+i+1
        a = [i for i in a if i % num != 0]
        i = i+1


N = int(input())
a = list(map(int, input().split()))
print(main(N, a))
Problem p02641 (python)

Fixed submission:
import numpy as np


def main(X, N, a):
    a.append(10000000000)
    a.append(-10000000000)
    a.sort()
    maxn = a[0]-1
    for i in range(len(a)-1):

        if a[i] >= X:
            if a[i+1]-a[i] > 1:
                if X-maxn>a[i]+1-X:
                    maxn = a[i]+1
                break
            if X-maxn < a[i]-X:
                break
        else:
            if a[i+1]-a[i] > 1:
                if a[i+1] > X and a[i] < X:
                    maxn = X
                    break
                maxn = a[i+1]-1

    return maxn


X, N = map(int, input().split())
try:
    a = list(map(int, input().split()))
except:
    a = []
print(main(X, N, a))

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


def main(X, N, a):
    a.append(10000000000)
    a.append(-10000000000)
    a.sort()
    maxn = a[0]-1
    for i in range(len(a)-1):

        if a[i] >= X:
            if a[i+1]-a[i] > 1:
                if X-maxn>a[i]+1-X
                maxn = a[i]+1
                break
            if X-maxn < a[i]-X:
                break
        else:
            if a[i+1]-a[i] > 1:
                if a[i+1] > X and a[i] < X:
                    maxn = X
                    break
                maxn = a[i+1]-1

    return maxn


X, N = map(int, input().split())
try:
    a = list(map(int, input().split()))
except:
    a = []
print(main(X, N, a))
Problem p02645 (python)

Fixed submission:
import numpy as np


def main(M):
    ans = M[0:3]
    return ans


M = input()
print(main(M))

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


def main(A, B, V, W, T):
    if abs(B-A) <= T*(V-W):
        return "YES"
    return "NO"


A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
print(main(A, B, V, W, T))
Problem p02647 (python)

Fixed submission:
from numba import njit
import numpy as np


@njit
def main(N, K, A):
    for _ in range(min(K, 41)):
        ne = np.zeros_like(A)
        for i in range(N):
            ne[max(0, i-A[i])] += 1
            if i+A[i]+1 < N:
                ne[i+A[i]+1] -= 1
        A = ne.cumsum()
    return A


N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
ans = main(N, K, A)
print(*ans)

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

def main(N, K, A):
    for _ in range(min(K, 41)):
        ne = np.zeros_like(A)
        for i in range(N):
            ne[max(0, i-A[i])] += 1
            if i+A[i]+1 < N:
                ne[i+A[i]+1] -= 1
        A = ne.cumsum()
    return A


N, K = map(int, input().split())
A = np.array(input().split(), np.int64)
ans = main(N, K, A)
print(*ans)
Problem p02657 (python)

Fixed submission:
import numpy as np


def main(A, B):

    ans = A*B
    return ans


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

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


def count(a):
    i = 0
    while a > 0:
        i += 1
        a -= i
        if a == 0:
            break
        if a < 0:
            i -= 1
            break
    return i


def main(N):
    num = N
    ans = 0
    A = np.zeros((1000000), np.int32)
    i = 2
    last = 0
    if N == 1:
        return 0
    while True:
        if num % i == 0:
            num = num//i
            A[i] += 1
        else:
            i += 1
            if num == 1:
                break
            if i*i > num:
                last = 1
                break
    for j in range(i):
        ans += count(A[j])
    ans += last
    return ans


N = int(input())
print(main(N))

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


def main(A,B):

    ans = A*B
    return ans


A,B = int(input())
print(main(A,B))
Problem p02663 (python)

Fixed submission:
from numba import njit


@njit
def main(h, m, H, M, K):
    return max((H-h)*60+(M-m)-K, 0)


h, m, H, M, K = map(int, input().split())


print(main(h, m, H, M, K))

Buggy submission (verdict: Runtime Error):
def main(N, A):
    num = 1
    ans = 1
    for i in range(N+1):
        num -= A[i]
        if i < N:
            num *= 2
            ans += num
        if num <= 0 and i < N:
            return -1
    eda = 0
    for i in range(N+1):
        ans -= num
        eda += A[N-i]
        num -= eda
        num = num//2
        if num <= 0:

            break
    return ans


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

print(main(N, A))
Problem p02665 (python)

Fixed submission:
def main(N, A):
    num = 1
    ans = 1
    for i in range(N+1):
        num -= A[i]
        if i < N:
            num *= 2
            ans += num
        if num == 0 and i < N:
            return -1
        if num < 0:
            return -1
    eda = 0
    for i in range(N+1):
        ans -= num
        eda += A[N-i]
        num -= eda
        num = num//2
        if num <= 0:
            break
    return ans


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

print(main(N, A))

Buggy submission (verdict: Runtime Error):
from numba import njit

@ngit
def main(N, A):
    num = 1
    ans = 1
    if A[N] == 0:
        return -1
    for i in range(N+1):
        num -= A[i]
        if i < N:
            num *= 2
            ans += num
        if num <= 0 and i < N:
            return -1
    eda=0
    for i in range(N+1):
        ans -= num
        eda+=A[N-i]
        num -= eda
        num = num//2
        if num <= 0:
            num += A[N-i]
            break
    return ans


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

print(main(N, A))
Problem p02675 (python)

Fixed submission:
N=int(input())
for i in range(1):
  if N%10==3:
    print("bon")
    break
  if N%10==0:
    print("pon")
    break
  if N%10==1:
    print("pon")
    break
  if N%10==6:
    print("pon")
    break
  if N%10==8:
    print("pon")
    break
  print("hon")

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%10==3:
  print("bon")
else if N%10==0:
  print("pon")
else if N%10==1:
  print("pon")
else if N%10==6:
  print("pon")
else if N%10==8:
  print("pon")
else:
  print("hon")
Problem p02681 (python)

Fixed submission:
from numba import njit
import numpy as np


def main(S, T):
    if len(T)-len(S) != 1:
        print("No")
        return
    count = 0
    for i in range(len(S)):
        if S[i] != T[i]:
            count += 1
            if count > 0:
                print("No")
                return
    print("Yes")


S = input()
T = input()
main(S, T)

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


def main(S, T):
    if len(T)-len(S) != 1:
        print("No")
        return
    count = 0
    for i in range(len(S)):
        if S[i] != T[i]:
            count += 1
            if count > 0:
                print("No")
                return
    print("Yes")


main(S, T)

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


def main(S, T):
    if len(T)-len(S) != 1:
        print("No")
        return
    count = 0
    for i in range(len(S)):
        if S[i] != T[i+count]:
            count += 1
            if count > 1:
                print("No")
                return
    print("Yes")


def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', '')(main)
    cc.compile()


if __name__ == '__main__':
    import sys
    if sys.argv[-1] == 'ONLINE_JUDGE':
        cc_export()
        exit(0)
    from my_module import main
    S = input()
    T = input()
    main(S, T)
Problem p02608 (python)

Fixed submission:
print_cnt = int(input())

result = [0] * 10000

for x in range(100):
  for y in range(100):
    for z in range(100):
      if x*y*z == 0:
        continue
      tmp = x*x + y*y + z*z + x*y + y*z + z*x
      if tmp <= 10000:
        result[tmp-1] += 1

for i in range(print_cnt):
  print(result[i])

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

result = [0] * 1000

for x in range(100):
  for y in range(100):
    for z in range(100):
      if x*y*z == 0:
        continue
      tmp = x*x + y*y + z*z + x*y + y*z + z*x
      if tmp <= 1000:
        result[tmp-1] += 1

for i in range(print_cnt):
  print(result[i])
Problem p02614 (python)

Fixed submission:
h,w,k=map(int,input().split())
board=[list(input()) for _ in range(h)]
ans=0
for paint_h in range(2**h): #すべての行の塗りつぶし方を2進数で列挙する
 for paint_w in range(2**w): #すべての列の塗りつぶし方を2進数で列挙する
   cnt=0
   for i in range(h): #すべてのi行目j列目の要素についてみる
     for j in range(w):
       if (paint_h>>i)&1==0 and (paint_w>>j)&1==0: #各行のi番目のビットと各列のj番目のビットがともに0であればそのマスは塗りつぶされない
         if board[i][j]=='#': #塗りつぶされないマスが黒マスであれば個数を+1する
           cnt+=1
   if cnt==k: #塗りつぶされない黒マスの個数がKに等しければ答えを+1する
     ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
h, w, k = map(int,input().split())
c = [list(input()) for i in range(h)]
ans = 0
for p_h in range(2**h):
    for p_w in range(2**w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (p_h>>i)&1==0 and (p_w>>j)&==0:
                    if c[i][j]=='#':
                        black += 1
        if black == k:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
c = [input(i) for i in range(h)]
ans = 0
for p_h in range(2**h):
    for p_w in range(2**w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (p_h>>i)&1==0 and (p_w>>j)&1==0:
                    if c[i][j]=='#'
                        black +=1
        if black == k:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
 h,w,k = map(int,input().split())
 board = [list(input()) for i in range(h)]
 ans = 0
 for paint_h in range(2**h):
     for paint_w in range(2**w):
         cnt = 0
         for i in range(h):
             for j in range(w):
                 if(paint_h >> i)&1==0 and (paint_w >> j)&1==0:
                    if board[i][j]=='#':
                        cnt += 1
        if cnt ==k:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h,w,k = map(int,input().split())
board = [list(input()) for _ in range]
ans = 0
for paint_h in range(2**h):
    for paint_w in range(2**w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if(paint_h>>i)&1==0 and (paint_w>>j)&1==0:
                    if board[i][j]=='#':
                        cnt += 1
        if cnt == k:    
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h,w,k = map(int,input().split())
board = [list(input()) for _ in range]
ans = 0
for paint_h in range(2**h):
    for paint_w in range(2**w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if(paint_h>>i)&1==0 and (paint_w>>j)&1==0:
                    cnt += 1
        if cnt == k:    
            ans += 1
print(ans)
Problem p04001 (python)

Fixed submission:
def dfs(i,s):
    if i==n-1:
        return sum(map(int,s.split('+')))
    return dfs(i+1,s+S[i+1])+dfs(i+1,s+'+'+S[i+1])

S=input()
n=len(S)
ans=dfs(0,S[0])
print(ans)

Buggy submission (verdict: Runtime Error):

def a(t,i):
    if i= len(s)-1:
        return sum(map(int,t.split('+')))
    return a(t+s[i+1],i+1) + a(t+'+'+s[i+1],i+1) #関数の中に入れると最後の項でまとめて処理できる
s = input()
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
#入力
#関数へ
#関数
    #
def a(t,i):
    if j = len(s)-1:
        return sum(map(int,t.split('+')))
    return a(t+s[i+1],i+1) + a(t+'+'+s[i+1],i+1) #関数の中に入れると最後の項でまとめて処理できる
s = input()
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(t,i):
    if i == n-1:
        return sum(map(int,t.split()))
    return a(t+s[i+1],i+1)+ a(t+"+"+s[i+1],i+1)

s = input()
n = len(s)
i=0
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(t,i):
    if i == n-1:
        return sum(map(int,t.split()))
    return a(t+s[i+1],i+1)+ a(t+"+"+s[i+1])

s = input()
n = len(s)
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(s,i):
    if i == n-1:
        return sum(map(int,s.split()))
    return a(s[i]+s[i+1],i+1)+ a(s[i]+"+"+s[i+1])

s = input()
n = len(s)
i=0
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(s,i):
    if i == n-1:
        return eval(s)
    return a(s[i]+s[i+1],i+1)+ a(s[i]+"+"+s[i+1])

s = input()
n = len(s)
i=0
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(s,i):
    if i == l-1:
        return sum(map(int,s.split("+")))
    return a(s+s[i+1],i+1)+a(s+"+"+s[i+1],i+1)
s = input()
l = len(s)
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):
def a(t,i):
    if i==l-1:
        return sum(map(int,t.split('+'))))
    return a(t+s[i+1],i+1)+a(t+'+'+s(i+1),i+1)
s=input()
l = len(s)
print(a(s[0],0))

Buggy submission (verdict: Runtime Error):

def a(t,i):
    if i==l-1:
        print(sum(map(int,t.split('+'))))
        exit()
    return a(t+s[i+1],i+1)+a(t+'+'+s(i+1),i+1)

s=input()
a(s[0],0)
l = len(s)

Buggy submission (verdict: Runtime Error):

def a(t,i):
    if i==l-1:
        print(sum(map(int,t.split('+'))))
        exit()
    return a(t+s[i+1],i+1)+a(t+'+'+s(i+1),i+1)

s=input()
a(s[0],0)
l = s.len()

Buggy submission (verdict: Runtime Error):

def a(t,i):
    if i==l-1:
        print(sum(map(int,t.split('+'))))
        exit()
    a(t+s[i+1])+a(t+'+'+s(i+1))

s=input()
a(s[0],0)
l = s.len()

Buggy submission (verdict: Runtime Error):


def a(t,i):
    if i==l-1:
        print(sum(int(t.split('+'))))
        exit()
    a(t+s[i+1])+a(t+'+'+s(i+1))

s=input()
a(s[0],0)
l = s.len()

Buggy submission (verdict: Runtime Error):
def a(t,i):
    if i=l-1:
        print(sum(int(t.split('+'))))
        exit()
    a(t+s[i+1])+a(t+'+'+s(i+1))

s=input()
a(s[0],0)
l = s.len()

Buggy submission (verdict: Runtime Error):
def dfs(i,Str):
    if i==n:
        return sum(map(int,Str.split()))
    return dfs(i+1,Str+S[i+1])+dfs(i+1,Str+"+"+S[i+1])
S=input()
n=len(S)
print(dfs(0,S[0]))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int(intput().split()))
print(a * b)

Buggy submission (verdict: Runtime Error):
a, b = int(intput().split())
print(a * b)
Problem p02675 (python)

Fixed submission:
a = int(input())

while a > 10:
    a = a % 10

if a == 2 or a == 4 or a == 5 or a == 7 or a == 9:
    print("hon")
elif a == 0 or a == 1 or a == 6 or a == 8:
    print("pon" )
else:
    print("bon" )

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

while a > 10:
    a = a % 10

if a == 2 or a == 4 or a == 5 or a == 7 or a == 9
    print("hon")
elif a == 0 or a == 1 or a == 6 or a == 8:
    print("pon" )
else:
    print("bon" )
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

print("Yes" if S == T[:-1] else "No" )

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

if S.length == 0 or S.length >= 11:
    print("No" )
else:
    for i in range(S.length):
        if S[i] !=  T[i]:
            return print("No")
        
    if T.length == S.length + 1:
        print("Yes" )

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

if S.length == 0 || S.length >= 11:
    print("No" )
else:
    for i in range(S.length):
        if S[i] !=  T[i]:
            return print("No")
        
    if T.length == S.length + 1:
        print("Yes" )
Problem p02694 (python)

Fixed submission:
import math
X = int(input())
Y = 100
count = 0
while Y < X:
    Y = Y + Y // 100
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math
X = int(input())
Y = 100
count = 0
while Y =< X:
    Y = math.floor(Y * 1.01)
    count += 1

print(count)
Problem p02646 (python)

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T=int(input())

if(A<B):
  if(B+W*T <= A+V*T):
    print("YES")
  else:
    print("NO")
elif(B<A):
  if(A-V*T <= B-W*T):
    print("YES")
  else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T=int(input())

if(A<B):
  if(B+W*T <= A+V*T):
    print("YES")
  else:
    print("NO")
elif(B<A):
    if(A-V*T <= B-W*T):
    print("YES")
  else:
    print("NO")
Problem p02690 (python)

Fixed submission:
X=int(input())
N=10**3
i=-1000
res=[]

while(i<N):
  j=-1000
  while(j<N):
    if(i**5 - j**5==X):
      res.append(i)
      res.append(j)
      break
    j+=1
  if(1<len(res)):
    break
  i+=1

print(str(res[0])+" " +str(res[1]))

Buggy submission (verdict: Runtime Error):
X=int(input())
N=10**3
i=-10
res=[]

while(i<N):
  j=-10
  while(j<N):
    if(i**5 - j**5==X):
      res.append(i)
      res.append(j)
      break
    j+=1
  if(1<len(res)):
    break
  i+=1

print(str(res[0])+" " +str(res[1]))
Problem p02713 (python)

Fixed submission:
import math

K=int(input())
r=0

for i in range(1,K+1):
  for j in range(1,K+1):
    a=math.gcd(i,j)
    for k in range(1,K+1):
      b=math.gcd(a,k)
      r+=b
print(r)

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

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K=int(input())

i=1
j=1
k=1
r=0
list=[2,3,5,7,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199]

while(i<K+1):
  j=1
  f=0
  if(i in list == True):
    f=1
  while(j<K+1):
    k=1
    g=0
    if(j in list == True):
      g=1
    while(k<K+1):
      h=0
      if(k in list == True):
        h=1
      if(i==1 or j==1 or k==1):
        r+=1
      elif(f==1 and g==1 and h==1):
        if(i==j and j==k):
          r+=i
        else:
          r+=1
      else:
        r+=gcd(i, j, k)
      k+=1
    j+=1
  i+=1

print(r)
Problem p02741 (python)

Fixed submission:
K=int(input())

list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 3, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(list[K-1])

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

if(a>=c or b>=c):
  print("No")
else:
  r=round(math.sqrt(a),1000000000) + round(math.sqrt(b),1000000000)
  s=round(math.sqrt(c),1000000000)

  if(r<s):
    print("Yes")
  else:
    print("No")
Problem p02784 (python)

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

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

i=0
r=0

while(i<n):
  r+=list[i]
  i+=1

if(h<=r):
  print("Yes")
else:
  print("No")

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

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

i=0

r=0

while(i<3):
  r+=list[i]
  i+=1

if(h<=r):
  print("Yes")
else:
  print("No")