Buggy python submission (verdict: Time Limit Exceeded):
def make_lcs(a,b):
    a_size = len(a)
    b_size = len(b)
    lcs = [[0 for _ in range(a_size+1)] for _ in range(b_size+1)]
    for i in range(1,b_size+1):
        for j in range(1,a_size+1):
            if a[j-1] == b[i-1]:
                match = 1
            else:
                match = 0
            lcs[i][j] = max(lcs[i-1][j-1]+match, lcs[i-1][j], lcs[i][j-1])
    # ここまではlcs()と同じ

    # lcsを使用して復元
    res = ''
    i,j = b_size,a_size
    while((i>0) & (j>0)):
        if lcs[i][j] == lcs[i-1][j]:
            i -= 1
        elif lcs[i][j] == lcs[i][j-1]:
            j -= 1
        else:
            res = b[i-1] + res
            i -= 1
            j -= 1
    return res

def main():
    a = list(input())
    b = list(input())
    print(make_lcs(a,b))

if __name__ == "__main__":
    main()
    

Fixed submission:
def make_lcs(a,b):
    a_size = len(a)
    b_size = len(b)
    lcs = [[0 for _ in range(a_size+1)] for _ in range(b_size+1)]
    for i in range(1,b_size+1):
        for j in range(1,a_size+1):
            if a[j-1] == b[i-1]:
                match = 1
            else:
                match = 0
            lcs[i][j] = max(lcs[i-1][j-1]+match, lcs[i-1][j], lcs[i][j-1])
    # ここまではlcs()と同じ

    # lcsを使用して復元
    res = ''
    i,j = b_size,a_size
    while((i>0) & (j>0)):
        if lcs[i][j] == lcs[i-1][j]:
            i -= 1
        elif lcs[i][j] == lcs[i][j-1]:
            j -= 1
        else:
            res = b[i-1] + res
            i -= 1
            j -= 1
    return res

def main():
    a = list(input())
    b = list(input())
    print(make_lcs(a,b))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left
 
def lis(A: list):
    L = [A[0]]
    for a in A[1:]:
        if a > L[-1]:
            # Lの末尾よりaが大きければ増加部分列を延長できる
            L.append(a)
        else:
            # そうでなければ、「aより小さい最大要素の次」をaにする
            # 該当位置は、二分探索で特定できる
            L[bisect_left(L, a)] = a
    return len(L)

# l = [7,5,3,1,8]
# n = int(input())
# l = list(map(int,input().split()))

def dp_bubunnwa(l):
    n = len(l)
    m = sum(l)
    dp = [[0]*(m+1) for _ in range(n+1)]

    dp[0][0] = 1
    for i in range(n):
        for j in range(m+1):
            if l[i] <= j:
                dp[i+1][j] = dp[i][j-l[i]]+dp[i][j]
            else:
                dp[i+1][j] = dp[i][j]
    return dp

def bfs(G,start):
    from collections import deque
    dist = [-1] * n
    dist[start] = 0
    q = deque([start])
    add,pop=q.append,q.popleft
    while q:
        v = pop()
        for nv in G[v]:
            if dist[nv] < 0:
                dist[nv] = dist[v]+1
                add(nv)
            # 2部グラフ判定
            # else:
            #     if dist[v]%2 == dist[nv]%2:
            #         is_bipartite = False
    return dist


def lcs(a,b):
    a_size = len(a)
    b_size = len(b)
    lcs = [[0 for _ in range(a_size+1)] for _ in range(b_size+1)]
    for i in range(1,b_size+1):
        for j in range(1,a_size+1):
            if a[j-1] == b[i-1]:
                match = 1
            else:
                match = 0
            lcs[i][j] = max(lcs[i-1][j-1]+match, lcs[i-1][j], lcs[i][j-1])
    return lcs

def make_lcs(a,b):
    a_size = len(a)
    b_size = len(b)
    lcs = [[0 for _ in range(a_size+1)] for _ in range(b_size+1)]
    for i in range(1,b_size+1):
        for j in range(1,a_size+1):
            if a[j-1] == b[i-1]:
                match = 1
            else:
                match = 0
            lcs[i][j] = max(lcs[i-1][j-1]+match, lcs[i-1][j], lcs[i][j-1])
    # ここまではlcs()と同じ

    # lcsを使用して復元
    res = ''
    i,j = b_size,a_size
    while((i>0) & (j>0)):
        if lcs[i][j] == lcs[i-1][j]:
            i -= 1
        elif lcs[i][j] == lcs[i][j-1]:
            j -= 1
        else:
            res = b[i-1] + res
            i -= 1
            j -= 1
    return res
a = list(input())
b = list(input())
print(make_lcs(a,b))

Fixed submission:
def make_lcs(a,b):
    a_size = len(a)
    b_size = len(b)
    lcs = [[0 for _ in range(a_size+1)] for _ in range(b_size+1)]
    for i in range(1,b_size+1):
        for j in range(1,a_size+1):
            if a[j-1] == b[i-1]:
                match = 1
            else:
                match = 0
            lcs[i][j] = max(lcs[i-1][j-1]+match, lcs[i-1][j], lcs[i][j-1])
    # ここまではlcs()と同じ

    # lcsを使用して復元
    res = ''
    i,j = b_size,a_size
    while((i>0) & (j>0)):
        if lcs[i][j] == lcs[i-1][j]:
            i -= 1
        elif lcs[i][j] == lcs[i][j-1]:
            j -= 1
        else:
            res = b[i-1] + res
            i -= 1
            j -= 1
    return res

def main():
    a = list(input())
    b = list(input())
    print(make_lcs(a,b))

if __name__ == "__main__":
    main()