Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()

month = S[5:7]
day = S[8:10]


answer = 'Heisei'



if int(month)>4:
    answer = 'TBD'



print(int(S))

Fixed submission:
S = input()

month = S[5:7]

# print(int(month))
answer = 'Heisei'



if int(month)>4:
    answer = 'TBD'



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

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

#0の数がN-1になった時点で終了
#Aの中のminを割り出しそれのmodをA内でとるを繰り返す

mina = 0
while(1):
    if(len(A)==1):break
    mina = min(A)
    minaind = A.index(mina)
    delind =[]
    for i in range(0,len(A)):
        # print(A,minaind)
        if i == minaind:continue
        # print(i)
        A[i]%=mina
        if A[i] <= 0: delind.append(A.index(A[i]))
    for i in delind:
        del(A[i])

print(A[0])

Fixed submission:
N = int(input())

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

#0の数がN-1になった時点で終了
#Aの中のminを割り出しそれのmodをA内でとるを繰り返す

mina = 0
while(1):
    if(len(A)==1):break
    mina = min(A)
    minaind = A.index(mina)
    delind =[]
    for i in range(0,len(A)):
        # print(A,minaind)
        if i == minaind:continue
        # print(i)
        A[i]%=mina
        # if A[i] <= 0: delind.append(i)
    B=[]
    for i in range(0,len(A)):
        if(A[i]>0):
            B.append(A[i])
            
    A = B

print(A[0])
Buggy python submission (verdict: Runtime Error):
n,x= map(int,input().split())
a = input().rstrip().split() 
b = [0]*n

for i in range(0,n):
    b[i]=abs(int(a[i])-x)
b.sort()#昇順

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

def multi_GCD(le):
    # print(le)
    if len(le)==1:
        return 
    mxle=le[-1]
    del(le[-1])
    le[-1]=GCD(le[-1],mxle)
    multi_GCD(le)

if(len(b)==1):
    print(b[0])
if(len(b)==2):
    print(GCD(b[0],b[1]))
if(len(b)>2):
    multi_GCD(b)
    print(b[0])


Fixed submission:
import sys
sys.setrecursionlimit(500000)

n,x= map(int,input().split())
a = input().rstrip().split()
b = [0]*n
# a
for i in range(0,n):
    b[i]=abs(int(a[i])-x)
b.sort()#昇順

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

def multi_GCD(le):
    # print(le)
    if len(le)==1:
        return
    mxle=le[-1]
    del(le[-1])
    le[-1]=GCD(le[-1],mxle)
    multi_GCD(le)

if(len(b)==1):
    print(b[0])
if(len(b)==2):
    print(GCD(b[0],b[1]))
if(len(b)>2):
    multi_GCD(b)
    print(b[0])
Buggy python submission (verdict: Time Limit Exceeded):
n,k= map(int,input().split())

cnt = 0
for a in range(1,n+1):
    if (2*a) % k == 0:
        for b in range(a,n+1):
            if ((2*b) % k == 0)and((a+b) % k == 0 )and((a-b) % k == 0 ):
                for c in range(b,n+1):
                    if ((2*c) % k == 0)and((a+c) % k == 0 )and((c+b) % k == 0 ):
                        if (a==b)and(b==c):
                            cnt += 1
                        elif (a!=b)and(b!=c)and(a!=c):
                            cnt += 6
                        else:
                            cnt +=3
                        
                        

print(cnt)


Fixed submission:
#!/usr/bin/env python3
import sys
 
 
def solve(N: int, K: int):
    count = 0
 
    if K % 2 == 0:
        count += (N//K)**3
        # a,b,c == 0 mod K//2
        count += (N//(K//2) - N//K)**3
    else:
        count += (N//K)**3
    print(count)
    return
 
 
def main():
    N,K= map(int,input().split())
    # N = int(next(tokens))  # type: int
    # K = int(next(tokens))  # type: int
    solve(N, K)
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N,K= map(int,input().split())
X = list(map(int, input().split())) 

import numpy as np 


flag = 0
x_plus = [i for i in X if i>=0]
x_minus = [i for i in X if i<0]
x_minus.reverse()

len_plus = len(x_plus)
len_minus = len(x_minus)

use_x = []
answer = 0

i = 0
j = 0
if len_plus==0:
    answer = abs(x_minus[K-1])
    
if len_minus==0:
    answer = abs(x_plus[K-1])

if len_plus!=0 and len_minus!=0:
    while(1):
        if len(use_x)==K: break
        if x_plus[i] > abs(x_minus[j]):
            use_x.append(x_minus[j])
            if j+1>=len_minus:
                i += 1
            else:
                j += 1
        else:
            use_x.append(x_plus[i])
            if i+1>=len_minus:
                j += 1
            else:
                i += 1
    use_x.sort()
    # print(use_x)
    answer = use_x[-1]-use_x[0]+min(use_x[-1],abs(use_x[0]))

print(answer)

        



Fixed submission:
N,K= map(int,input().split())
X = list(map(int, input().split())) 

answer = 10**9

for i in range(N):
    if i+K-1>= N: break
    answer = min(answer,abs(X[i+K-1]-X[i])+min(abs(X[i]),abs(X[i+K-1])))

print(answer)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
for i in range(M):
    a[i]=input().rstrip().split()
# 左側の島の一番大きい島の１個→に橋をたてていく
#　全て分割されたら終了
#　左側は昇順になっている？なっていなかったらそこ修正
a = [[]*2]*M
sum = 0#分割の数
hasi = [0]*(N-1)#どこの橋を壊したか
for i in range(0,M):
    c1 = int(a[M-1-i][0])
    c2 = int(a[M-1-i][1])
    f = [False]
    for m in range(c1-1,c2-1):
        if hasi[m]==1:
            f[0]=True
    if f[0]==True:
        continue
    else:
        hasi[c1-1]=1
        sum = sum+1



print(sum)   


Fixed submission:
N,M = map(int,input().split())
a = list(list(map(int, input().split())) for x in range(M))

#aをbについて昇順にする。
a=sorted(a, key=lambda x: x[1])
hasi = -1#どこの橋を壊したか
sum = 0

for i in range(0,M):
    # print(c1,c2,hasi)
    if (hasi >= a[i][0])and (hasi < a[i][1]):
        continue
    else:
        hasi = a[i][1]-1
        sum = sum+1

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = input().rstrip().split()

le =[0]*N
le2 = [0]*N

for i in range(0,N):
    le[i]=int(li[i])

for i in range(0,N):
    le2[i]=le[i]-i-1
    le2.sort()

b = le2[int(N/2)]
sum = 0
for i in range(0,N):
    sum = sum + abs(le[i]-i-1-b)

print(sum)

Fixed submission:

N = int(input())
li = input().rstrip().split()

le =[0]*N
le2 = [0]*N

for i in range(0,N):
    le[i]=int(li[i])


for i in range(0,N):
    le2[i]=le[i]-i-1
le2.sort()


b = le2[int(N/2)]
sum = 0
for i in range(0,N):
    sum = sum + abs(le[i]-i-1-b)

print(sum)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
li = list(map(int, input().split()))
#左から最小値を探していく
#最小値を見つけたら、左側を最小値にしていく
#ないなら(１は１個しかない！！)最小値エリアの右端の値から最小値にしていく

mn = 1#min値を取得
mnix = li.index(1)
mnix0 =mnix #min値の最初のindex
sum = 0 #操作の回数
# li
f=[False]
#左側をまず1へ
while(1):
    if f[0]==True:
        break
    if (mnix+1-k) >0:
        for i in range(mnix+1-k,mnix+1):
            li[i] = mn
        sum +=1
        mnix=li.index(1)
    else:
        for i in range(0,k):
            li[i] = mn
        f[0]=True
        sum +=1

# li
#次に右側を1へ
if (mnix0+1-k) >0:
    #mnix0が右端
    migi = mnix0
if (mnix0+1-k) <=0:
    #k-1が右端
    migi = k-1
# migi

    
f[0]=False
if li[n-1]==1:
    f[0]=True
while(1):
    if f[0]==True:
        break
    if (migi+2)>(n-1):
        for i in range(migi,n):
            li[i] = mn
        sum +=1
        f[0]=True
    else:
        for i in range(migi,migi+k):
            li[i] = mn
        sum +=1
        migi = migi+k-1

 
print(sum)


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

min_ind = A.index(1)

print(int((N-1)/(K-1)) if (N-1)%(K-1)==0 else (N-1)//(K-1)+1)
Buggy python submission (verdict: Runtime Error):
#全部#の数を数える
#最小のルートを探し、そのルートで使ったますを数える（見つかんなかったら-1
#マスの数-最小のルートで使った歩数-最初に数えた#の数が答え
h,w= map(int,input().split())
arr = [input() for i in range(h)]
routed =  [[False for i in range(w)] for j in range(h)]
"""
arr=['.....................................',
 '...#...####...####..###...###...###..',
 '..#.#..#...#.##....#...#.#...#.#...#.',
 '..#.#..#...#.#.....#...#.#...#.#...#.',
 '.#...#.#..##.#.....#...#.#.###.#.###.',
 '.#####.####..#.....#...#..##....##...',
 '.#...#.#...#.#.....#...#.#...#.#...#.',
 '.#...#.#...#.##....#...#.#...#.#...#.',
 '.#...#.####...####..###...###...###..',
 '.....................................']

arr=['..#','#..','...']
h=3
w=3
"""
mnct=100000000
mn=[0]
cnt=0
def tansaku(x,y,cnt,mnct):
    # print(x,y,cnt)
    # print(routed)
    #この道は通った
    cnt+=1
    #ゴールに着いたら最小経路を更新してリターン
    if (x==h-1) and (y == w-1):

        # print("Goal!")
        if mnct>cnt:
            mnct= cnt
            mn[0]=mnct
        return
    #下に行ける


    if(x<h-1)and(arr[x+1][y]!='#')and(routed[x+1][y]==False):
        routed[x+1][y]=True
        tansaku(x+1,y,cnt,mnct)
        routed[x+1][y]=False
    #→にいける

    if(y<h-1)and(arr[x][y+1]!='#')and(routed[x][y+1]==False):
        routed[x][y+1]=True
        tansaku(x,y+1,cnt,mnct)
        routed[x][y+1]=False

    #左にいける
    if(y>0)and(arr[x][y-1]!='#')and(routed[x][y-1]==False):
        routed[x][y-1]=True
        tansaku(x,y-1,cnt,mnct)
        routed[x][y-1]=False
    #上にいける

    if(x>0)and(arr[x-1][y]!='#')and(routed[x-1][y]==False):
        routed[x-1][y]=True
        tansaku(x-1,y,cnt,mnct)
        routed[x-1][y]=False



    # print("Game Over!")
    return

tansaku(0,0,0,mnct)


ans=0
for i in range(0,h):
    ans+=arr[i].count('#')

print(h*w-mn[0]-ans)


Fixed submission:
h,w = map(int,input().split())
s = [input() for _ in range(h)]

from collections import deque

ans = 0
stack = deque([[0,0,1]])
dxdy = [(0,1),(0,-1),(1,0),(-1,0)]
visited = [[0 for i in range(w)] for j in range(h)]
minus = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            visited[i][j] = 1
            minus += 1


ans = -1
while(stack):
    ne = stack.popleft()
    x,y = ne[0],ne[1]
    if x < 0 or x > h-1: continue
    if y < 0 or y > w-1: continue
    if visited[x][y] == 1: continue
    if x== h -1 and y == w-1:
        ans = h*w - ne[2] - minus

    visited[x][y] = 1

    for dx,dy in dxdy:
        stack.append([dx+x,dy+y,ne[2]+1])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

import bisect

def solve(N,A,B,C):

    # A=['3', '14', '159', '2', '6', '53']
    # B=['58', '9', '79', '323', '84', '6']
    # C=['2643', '383', '2', '79', '50', '288']
    A,B,C=list(map(int, A)),list(map(int, B)),list(map(int, C))
    A=sorted(A)
    B=sorted(B)
    C=sorted(C)
    # print(A)
    # print(B)
    # print(C)
    D = [0]*N
    E = [0]*N
    for i in range(N):
        a = A[i]
        # print(N-bisect.bisect_right(B,a))
        D[i]= N-bisect.bisect_right(B,a)
        #bはaより大きい数字が何個あるか分かれば良い
        #cはbの
    # print(D)

    for i in range(N):
        b = B[i]
        E[i] = N-bisect.bisect_right(C,b)
    
    # print(E)
    answer = 0
    for i in range(N):
        d=N-D[i]
        answer+=sum(E[d:])

    print(answer)

    
 
 
def main():
    N = int(input())
    A=input().rstrip().split()
    B=input().rstrip().split()
    C=input().rstrip().split()
    solve(N,A,B,C)

 
 
if __name__ == '__main__':
    main()

Fixed submission:

import bisect

def solve(N,A,B,C):

    # A=['3', '14', '159', '2', '6', '53']
    # B=['58', '9', '79', '323', '84', '6']
    # C=['2643', '383', '2', '79', '50', '288']
    A,B,C=list(map(int, A)),list(map(int, B)),list(map(int, C))
    A=sorted(A)
    B=sorted(B)
    C=sorted(C)
    # print(A)
    # print(B)
    # print(C)
    D = [0]*N
    # E = [0]*N
    # for i in range(N):
    #     a = A[i]
    #     # print(N-bisect.bisect_right(B,a))
    #     D[i]= N-bisect.bisect_right(B,a)
    #     #bはaより大きい数字が何個あるか分かれば良い
    #     #cはbの
    # # print(D)

    for i in range(N):
        b = B[i]
        D[i]=bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b))
        # print(b,'より小さいのは',bisect.bisect_left(A,b))
        # print(b,'より大きいのは',N-bisect.bisect_right(C,b))
    print(sum(D))
    # print(E)
    # answer = 0
    # for i in range(N):
    #     d=N-D[i]
    #     answer+=sum(E[d:])

    # print(answer)

    
 
 
def main():
    N = int(input())
    # A,B,C=0,0,0
    A=input().rstrip().split()
    B=input().rstrip().split()
    C=input().rstrip().split()
    solve(N,A,B,C)

 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a/GCD(a,b)*b)

def multi_LCM(le):
    if len(le)==1:
        return 
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])

Fixed submission:
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a*b//GCD(a,b))

def multi_LCM(le):
    # print(le)
    if len(le)==1:
        return
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])

Buggy python submission (verdict: Runtime Error):
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a*b/GCD(a,b))

def multi_LCM(le):
    if len(le)==1:
        return 
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])


Fixed submission:
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a*b//GCD(a,b))

def multi_LCM(le):
    # print(le)
    if len(le)==1:
        return
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])

Buggy python submission (verdict: Runtime Error):
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a*b/GCD(a,b))

def multi_LCM(le):
    if len(le)==1:
        return 
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)
multi_LCM(le)
print(le[0])


Fixed submission:
N = int(input())
le = [int(input()) for i in range(N)]
le.sort()#昇順
#３数以上の最小公倍数を求める問題
#a,b2数の最小公倍数とcの最小公倍数で求められる
#２数の最小公倍数はユークリッドの互除法を利用して再帰関数で求められる。

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


def LCM(a,b):
    return int(a*b//GCD(a,b))

def multi_LCM(le):
    # print(le)
    if len(le)==1:
        return
    mxle=le[-1]
    del(le[-1])
    le[-1]=LCM(le[-1],mxle)
    multi_LCM(le)

if(len(le)==2):
    le[0]=LCM(le[0],le[1])
if(len(le)>=2):
    multi_LCM(le)

print(le[0])
Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
a_list = sorted([int(i) for i in input().split()])

count = 0
while len(a_list) > 2:
    x = a_list[0]
    if x == a_list[1]:
        a_list = a_list[1:]
    else:
        count += 1
        a_list = [i for i in a_list[1:] if i % x != 1]

if a_list[0] % a_list[1] != 0:
    count += 1

print(count)


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

max_num = max(a_list)

is_ans = [False]*(max_num+1)
memo = [0]*(max_num+1)
for i in a_list:
    is_ans[i] = True
    memo[i] += 1

for i in range(1, max_num+1):
    if is_ans[i]:
        for j in range(2*i, max_num+1, i):
                is_ans[j] = False

    if memo[i] > 1:
        is_ans[i] = False

ans = is_ans.count(True)
print(ans)

Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
counter = collections.Counter()

for i in input().split():
    x = int(i)
    counter[x] += 1

a_list = sorted([i for i, v in counter.items() if v == 1])

def func(x, nums, count):
    if len(nums) == 0:
        return count
    else:
        new_nums = [i for i in nums if i % x != 0]
        count += 1
        return func(new_nums[0], new_nums[1:], count)

if len(a_list) == 0:
    count = 0
else:
    count = func(a_list[0], a_list[1:], 1)

print(count)


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

max_num = max(a_list)

is_ans = [False]*(max_num+1)
memo = [0]*(max_num+1)
for i in a_list:
    is_ans[i] = True
    memo[i] += 1

for i in range(1, max_num+1):
    if is_ans[i]:
        for j in range(2*i, max_num+1, i):
                is_ans[j] = False

    if memo[i] > 1:
        is_ans[i] = False

ans = is_ans.count(True)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = sorted([int(i) for i in input().split()])

if a[0] == 0:
  print(0)
else:
  ans = 1
  for i in a_list:
    ans *= i
    if i > 10**18:
      ans = -1
      break
  print(ans)

Fixed submission:
n = int(input())
a_list = sorted([int(i) for i in input().split()])

if a_list[0] == 0:
  print(0)
else:
  ans = 1
  for i in a_list:
    ans *= i
    if ans > 10**18:
      ans = -1
      break
  print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a_list = sorted[int(i) for i in input().split()])

if a[0] == 0:
  print(0)
else:
  ans = 1
  for i in a_list:
    ans *= i
    if i > 10**18:
      ans = -1
      break
  print(ans)

Fixed submission:
n = int(input())
a_list = sorted([int(i) for i in input().split()])

if a_list[0] == 0:
  print(0)
else:
  ans = 1
  for i in a_list:
    ans *= i
    if ans > 10**18:
      ans = -1
      break
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = [int(i) for i in input().split()]

ans = 1
for i in a_list:
  ans *= i

if ans > 10**18:
  ans = -1
    
print(ans)

Fixed submission:
n = int(input())
a_list = sorted([int(i) for i in input().split()])

if a_list[0] == 0:
  print(0)
else:
  ans = 1
  for i in a_list:
    ans *= i
    if ans > 10**18:
      ans = -1
      break
  print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b = [int(i) for i in input().split()]

print(math.floor(a*b))

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

x = int(a)
y = round(100*float(b))

print(x * y // 100)
Buggy python submission (verdict: Runtime Error):
import math
def solve(a, b, h, m):

    deg_a = math.radians(0.5 * (h * 60 + m))
    deg_b = math.radians(6 * m)

    y_a = a * round(math.cos(deg_a),10)
    x_a = a * round(math.sin(deg_a),10)

    y_b = b * round(math.cos(deg_b),10)
    x_b = b * round(math.sin(deg_b),10)
    ans = math.sqrt((x_b - x_a)**2 + (y_b - y_a)**2)
    return ans

if __name__ == "__main__":
    a,b,h,m = [int(i) for i in input()]
    print(solve(a, b, h, m))

Fixed submission:
import math
def solve(a, b, h, m):

    deg_a = math.radians(0.5 * (h * 60 + m))
    deg_b = math.radians(6 * m)

    y_a = a * math.cos(deg_a)
    x_a = a * math.sin(deg_a)

    y_b = b * math.cos(deg_b)
    x_b = b * math.sin(deg_b)
    ans = math.sqrt((x_b - x_a)**2 + (y_b - y_a)**2)
    return ans

if __name__ == "__main__":
    a,b,h,m = [int(i) for i in input().split()]
    print(solve(a, b, h, m))

Buggy python submission (verdict: Runtime Error):
import math
def solve(a, b, h, m):

    deg_a = math.radians(0.5 * (h * 60 + m))
    deg_b = math.radians(6 * m)

    y_a = a * round(math.cos(deg_a),10)
    x_a = a * round(math.sin(deg_a),10)

    y_b = b * round(math.cos(deg_b),10)
    x_b = b * round(math.sin(deg_b),10)
    print(x_a, y_a)
    print(x_b, y_b)
    ans = math.sqrt((x_b - x_a)**2 + (y_b - y_a)**2)
    return ans

if __name__ == "__main__":
    a,b,h,m = [int(i) for i in input()]
    print(solve(a, b, h, m))


Fixed submission:
import math
def solve(a, b, h, m):

    deg_a = math.radians(0.5 * (h * 60 + m))
    deg_b = math.radians(6 * m)

    y_a = a * math.cos(deg_a)
    x_a = a * math.sin(deg_a)

    y_b = b * math.cos(deg_b)
    x_b = b * math.sin(deg_b)
    ans = math.sqrt((x_b - x_a)**2 + (y_b - y_a)**2)
    return ans

if __name__ == "__main__":
    a,b,h,m = [int(i) for i in input().split()]
    print(solve(a, b, h, m))
Buggy python submission (verdict: Time Limit Exceeded):
def solve(n, xs):

    ans = 0
    for i in range(n):
        for j in range(i,n):
            if abs(i-j) == xs[i] + xs[j]:
                ans +=1

    return ans
if __name__ == "__main__":
    n = int(input())
    xs = [int(i) for i in input().split()]
    print(solve(n, xs))


Fixed submission:
def solve(n, xs):

    ans = 0
    tmp = {}
    for i in range(n-1, -1, -1):
        l = i+1 + xs[i]
        r = i+1 - xs[i]

        if l in tmp:
            ans += tmp[l]

        if r in tmp:
            tmp[r] += 1
        else:
            tmp[r] = 1

    return ans
if __name__ == "__main__":
    n = int(input())
    xs = [int(i) for i in input().split()]
    print(solve(n, xs))
Buggy python submission (verdict: Runtime Error):
s, w = [int(i) for i in input().spli()]
if s <= w:
  print("unsafe")
else:
  print("safe")

Fixed submission:
s, w = [int(i) for i in input().split()]
if s <= w:
  print("unsafe")
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
def slove(a, b):

    return min(a,b)

if __name__ == "__main__":

    a, b = inpu().split()

    ans = slove(a, b)
    print(ans)


Fixed submission:
def make_num(a, b):
    num = ""
    for i in range(b):
        num += str(a)
    return num

def slove(a, b):

    num1 = make_num(a, b)
    num2 = make_num(b, a)
    
    return min(num1, num2)

if __name__ == "__main__":

    a, b = [int(i) for i in input().split()]
    ans = slove(a, b)
    print(ans)