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

ans_r=0
for p in range(0, N):
  for q in range(0, p):
    if (P[p] > P[q]):
      ans_r += 1
      break
print (N-ans_r)



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

ans_r=0
min_num=P[0]
for p in range(0, N):
  if (min_num > P[p]):
    min_num=P[p]
  if (min_num < P[p]):
    ans_r += 1
print (N-ans_r)

Buggy python submission (verdict: Runtime Error):
import numpy as num
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(1):
        l=np.amin(np.array(P[:i+1]))
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(1):
        l=min(P[:i+1])
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(i):
        l=min(P[:i])
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)


Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(i):
        l=min(P[:i])
        if P[i]>l:
            flag=False
    if flag:
        count+=1
    else:
        flag=True
print(count)


Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(i):
        if P[i]>P[k]:
            flag=False
    if flag:
        count+=1
    else:
        flag=True
print(count)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(i):
        if P[i]>P[k]:
            flag=False
    if flag:
        count+=1
    else:
        flag=True
print(count)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
count=1
min=P[0]
for i in range(1,N):
    if min>P[i]:
      count+=1
      min=P[i]
print(count)