Buggy python submission (verdict: Time Limit Exceeded):
# Time Complexity: O(n^2)
# TLE
n, N = int(raw_input()), []
for i in xrange(n):
    N.append(int(raw_input()))

def LIS(lis, A, flag):
    '''
    '''
    if flag == 1 and len(A) != 0:
        lis.append(A[0])

    if len(A) == 0:
        if len(lis) == 0: return 0
        return len(lis)
    elif len(lis) > 1:
        if lis[-2] >= lis[-1]:
            return 0

    return max(LIS(lis[:], A[1:], 1), LIS(lis[:], A[1:], 0))

print max(LIS([], N[:], 1), LIS([], N[:], 0))

Fixed submission:
import bisect

def _input(n):
    return [int(raw_input()) for i in xrange(n)]

# Wrapper for built-in function
def lower_bound(arr, target):
    return bisect.bisect_right(arr, target)


def LIS(arr, n):
    L = [0] * n

    L[0] = arr[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < arr[i]:
            L[length] = arr[i]#L.append(A[i])
            length += 1
        else:
            if L[lower_bound(L[:length], arr[i])-1 if lower_bound(L[:length], arr[i])-1 > 0 else 0] \
                    != arr[i]: # Fix common item - Dont insert common item and zero Problem
                L[lower_bound(L[:length], arr[i])] = arr[i]
    return length, L

#=========================================================
def main():

    n = int(raw_input())
    arr = _input(n)
    print LIS(arr, n)[0]#, LIS(arr, n)[1]#, arr

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def _input(n):
    return [int(raw_input()) if i in xrange(n)]

def LIS(arr):
    arr = [0] + arr
    L = [0] + [0] * len(arr)
    P = [-1] + [0] * len(arr)

    for i in xrange(1, len(arr)):
        k = 0
        for j in xrange(0, i):
            if arr[j] < arr[i] and L[j] > L[k]:
                k = j
        L[i] = L[k] + 1
        P[i] = k

    return max(L)

#==============================================
def main():
    n = int(raw_input())
    arr = _input(n)
    print LIS(arr)

if __name__ == "__main__":
    main()

Fixed submission:
import bisect

def _input(n):
    return [int(raw_input()) for i in xrange(n)]

# Wrapper for built-in function
def lower_bound(arr, target):
    return bisect.bisect_right(arr, target)


def LIS(arr, n):
    L = [0] * n

    L[0] = arr[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < arr[i]:
            L[length] = arr[i]#L.append(A[i])
            length += 1
        else:
            if L[lower_bound(L[:length], arr[i])-1 if lower_bound(L[:length], arr[i])-1 > 0 else 0] \
                    != arr[i]: # Fix common item - Dont insert common item and zero Problem
                L[lower_bound(L[:length], arr[i])] = arr[i]
    return length, L

#=========================================================
def main():

    n = int(raw_input())
    arr = _input(n)
    print LIS(arr, n)[0]#, LIS(arr, n)[1]#, arr

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def _input(n):
    return [int(raw_input()) for i in xrange(n)]

def LIS(arr):
    arr = [0] + arr
    L = [0] + [0] * len(arr)
    P = [-1] + [0] * len(arr)

    for i in xrange(1, len(arr)):
        k = 0
        for j in xrange(0, i):
            if arr[j] < arr[i] and L[j] > L[k]:
                k = j
        L[i] = L[k] + 1
        P[i] = k

    return max(L)

#==============================================
def main():
    n = int(raw_input())
    arr = _input(n)
    print LIS(arr)

if __name__ == "__main__":
    main()

Fixed submission:
import bisect

def _input(n):
    return [int(raw_input()) for i in xrange(n)]

# Wrapper for built-in function
def lower_bound(arr, target):
    return bisect.bisect_right(arr, target)


def LIS(arr, n):
    L = [0] * n

    L[0] = arr[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < arr[i]:
            L[length] = arr[i]#L.append(A[i])
            length += 1
        else:
            if L[lower_bound(L[:length], arr[i])-1 if lower_bound(L[:length], arr[i])-1 > 0 else 0] \
                    != arr[i]: # Fix common item - Dont insert common item and zero Problem
                L[lower_bound(L[:length], arr[i])] = arr[i]
    return length, L

#=========================================================
def main():

    n = int(raw_input())
    arr = _input(n)
    print LIS(arr, n)[0]#, LIS(arr, n)[1]#, arr

if __name__ == "__main__":
    main()