Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))

    P = np.array(P)

    ans = 0
    i = N
    while i != 0:
        ans += 1
        i = np.argmin(P)
        P = P[0:i]
    print(ans)

    return 0


if __name__ == '__main__':
    main()

Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

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

def main():
    N = int(input())
    P = list(map(int, input().split()))

    P = np.array(P)

    ans = 0
    i = N
    while i != 0:
        ans += 1
        i = np.argmin(P)
        P = P[0:i]
    print(ans)

    return 0


if __name__ == '__main__':
    main()

Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect


def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    i = N
    m = 1
    if P[0] == 1:
        print(1)
        return 0

    for j in range(N):
        if len(P) == 1:
            ans+=1
            break

        try:
            i = P.index(m)
            ans += 1
        except ValueError:
            pass
        m += 1
        P = P[0:i]


    print(ans)

    return 0


if __name__ == '__main__':
    main()

Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect


def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    i = N
    for j in range(N):
        if i == 0:
            break
        ans += 1
        m = min(set(P[0:i]))
        i = P.index(m)

    print(ans)

    return 0


if __name__ == '__main__':
    main()

Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    first = P[0]-1
    i = N
    while i != 0:
        ans += 1
        m = min(P[0:i])
        i = P.index(m)

    print(ans)

    return 0

if __name__ == '__main__':
    main()


Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    first = P[0]-1

    while len(P) != 0:
        ans += 1
        m = min(P)
        if m == first:
            ans+=1
            break
        i = P.index(m)
        P = P[0:i]



    print(ans)

    return 0

if __name__ == '__main__':
    main()


Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0

    while len(P) != 0:
        m = min(P)
        i = P.index(m)
        P = P[0:i]
        ans += 1


    print(ans)

    return 0

if __name__ == '__main__':
    main()


Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    min = N+1

    while len(P) != 0:
        p = P.pop(0)
        if min > p:
            min = p
            ans+=1


    print(ans)

    return 0

if __name__ == '__main__':
    main()


Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    P = list(map(int, input().split()))

    ans = 0
    min = N+1

    while len(P) != 0:
        p = P.pop(0)
        if min > p:
            min = p
            ans+=1


    print(ans)

    return 0

if __name__ == '__main__':
    main()


Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()