Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 0
    for i in range(N):
        hantei = 0
        if i == 0:
            pass
        else:
            if min(P[:i]) < P[i]:
                hantei = 1
        if hantei == 0:
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 0
    for i in range(N):
        hantei = 0
        for j in range(i):
            if P[i] > P[j]:
                hantei = 1
                break
        if hantei == 0:
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    P = list(map(int,input().split()))
    a = 0
    for i in range(N):
        hantei = 0
        for j in range(i):
            if P[i] > P[j]:
                hantei = 1
                break
        if hantei == 0:
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
a = 0
for i in range(N):
    hantei = 'OK'
    for j in range(i):
        if P[i] > P[j]:
            hantei = 'NG'
            break
    if hantei == 'OK':
        a += 1

print(a)

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
a = 0
for i in range(N):
    hantei = 'OK'
    for j in range(i):
        if P[i] > P[j]:
            hantei = 'NG'
            break
    if hantei == 'OK':
        a += 1

print(a)

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
a = 0
for i in range(N):
    hantei = 'OK'
    for j in range(i):
        if P[i] > P[j]:
            hantei = 'NG'
    if hantei == 'OK':
        a += 1
    
print(a)

Fixed submission:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 1
    minP = P[0]
    for i in range(1, N):
        if minP < P[i]:
            pass
        else:
            minP = P[i]
            a += 1
    print(a)
if __name__ == '__main__':
    main()