Problem:


Score : 300 points

Problem Statement

Given is a permutation P_1, \ldots, P_N of 1, \ldots, N.
Find the number of integers i (1 \leq i \leq N) that satisfy the following condition:  

For any integer j (1 \leq j \leq i), P_i \leq P_j.

Constraints

1 \leq N \leq 2 \times 10^5

P_1, \ldots, P_N is a permutation of 1, \ldots, N.  

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
P_1 ... P_N

Output

Print the number of integers i that satisfy the condition.

Sample Input 1

5
4 2 5 1 3

Sample Output 1

3

i=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.

Similarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.

Sample Input 2

4
4 3 2 1

Sample Output 2

4

All integers i (1 \leq i \leq N) satisfy the condition.

Sample Input 3

6
1 2 3 4 5 6

Sample Output 3

1

Only i=1 satisfies the condition.

Sample Input 4

8
5 7 4 2 6 8 1 3

Sample Output 4

4

Sample Input 5

1
1

Sample Output 5

1



Sample input:
5
4 2 5 1 3


Sample output:
3

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
  if A[i] == min(A[:i+1]):
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))

cnt = 0
for i in range(1,N+1):
    if min(P[:i]) == P[i-1]:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
cnt =0
for i in range(n):
    flg = True
    for j in range(i):
        if p[i] > p[j]:
            flg = False
            break
    if flg:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_list = list(map(int, input().split()))

ans = 0
for i, p in enumerate(p_list):
    if p == min(p_list[:i+1]): ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 1
after = []
for i in range(1, N):
    after.append(P[i-1])
    if min(after) >= P[i]:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 1
after = []
for i in range(1, N):
    after.append(P[i-1])
    for a in after:
        if a < P[i]:
            break
    else:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(N):
    if P[i] == min(P[0:i+1]):
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
cnt = 1

for i in range(1,N):
    j = i
    tmp = 0
    while i > 0:
        if P[j] <= P[i-1]:
            tmp += 1
        i -= 1
    if j == tmp:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    for i in range(n):

        if i == 0 or p[i] <= min(p[:i]):
            cnt += 1

        # temp = True
        # for j in range(i):
        #     if p[i] > p[j]:
        #         temp = False
        #         break
        # if temp:
        #     cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    for i in range(n):
        temp = True
        for j in range(i):
            if p[i] > p[j]:
                temp = False
                break
        if temp:
            cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(n):
    if p[i]==min(p[:i+1]):
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
List = []
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    tmp = P[i-1]
    List.append(tmp)
    if(P[i] <= min(List)):
      ans += 1
print(str(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_list = list(map(int, input().split()))

cnt = 0
for i in range(n):
    if p_list[i] == min(p_list[:i+1]):
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))

total=0
for i in range(1,N+1):
    A=P[:i]
    B=sorted(A)
    if B[0]==A[i-1]:
        total+=1
print(total)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))

total=1
for i in range(1,N):
    A=P[:i:]
    if P[i]<min(A):
        total+=1
print(total)

Submission status: Time Limit Exceeded

Solution code:
import math
import copy

neko = 0
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    if p[i] <= min(p[:i+1]):
        neko += 1
print(neko)

Submission status: Time Limit Exceeded

Solution code:
import math
import copy

neko = 0
n = int(input())
p = [int(x) for x in input().split()]
for i in range(n):
    for j in range(i):
        if p[i] > p[j]:
            neko += 1 
            break
print(n-neko)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
i = list(map(int, input().split()))
s=[]
cnt=0
for j in range(n):
    s.append(i[j])
    if min(s)==i[j]:
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:

n=int(input())
p=list(map(int,input().split()))

cnt=0

for i in range(n):
    if min(p[:i+1])==p[i]:
        cnt+=1
    else:
        continue

print(cnt)

Submission status: Time Limit Exceeded

Solution code:

n=int(input())
p=list(map(int,input().split()))

cnt=0

for i in range(n):
    if min(p[:i+1])>=p[i]:
        cnt+=1
    else:
        continue

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = list(map(int , input().split()))
count = 0
for i in range(n):
  if s[i] == min(s[:i + 1]):
    count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
B=list(map(int,input().split()))
cnt=0
for i in range(n):
  if min(B[:i+1])==B[i]:
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if p[i] <= min(p[:i+1]):
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i + 1):
        if p[i] > p[j]:
            break
    else:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
min = 10000000000000
for i in range(1, N+1):
    if min > P[i]:
        min = P[i]
    elif min < P[i]:
        continue

    for j in range(1, i+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
        
    if P[i] == 1:
        break

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):
    for j in range(1, i+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
        
    if P[i] == 1:
        break

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
P_ = [0] * len(P)
     
count = 0
for i in range(1, N+1):
    P_[P[i]] = 1
    if sum(P_[:P[i]]) > 0:
        continue
    count += 1
    if sum(P_[:P[i]]) == P[i]-1:
        break

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
P_ = [0] * len(P)
     
count = 0
for i in range(1, N+1):
    P_[P[i]] = 1
    if sum(P_[:P[i]]) > 0:
        continue
    count += 1
    if P[i] == 1:
        break

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
P_ = [0] * len(P)
     
count = 0
for i in range(1, N+1):
    P_[P[i]] = 1
    if sum(P_[:P[i]]) > 0:
        continue
    count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):
    #print(P[1:i+1])
    #print(len(list(set(P[1:i+1]))))
    for j in range(1, len(list(set(P[1:i+1])))+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
else:
    print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):
    if not any(P[i] > np.array(list(set(P[1:i+1])))):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):    
    if not any(P[i] > np.array(P[1:i+1])):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):
    #print(P[i])
    #print(P[1:i+1])
    a = np.array([P[i]] * i)
    b = np.array(P[1:i+1])
    #print( a > b )
    #print(any(a > b))
    
    if not any(a > b):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:

N = int(input())

P = list(map(int, input().split()))

P = [0] + P
     
count = 0
for i in range(1, N+1):
    for j in range(1, i+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
else:
    print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
ans=0
count=0
for i in range(n):
    for j in range(i+1):
        if p[i]<=p[j]:
            count=1
        else:
            count=0
            break
    ans=ans+count
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
# = map(int, input().split())
P = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

count = 0

for i in range(N):
    if P[i] == 1:
        count += 1
        break
    if P[i] == min(P[:i+1]):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
# = map(int, input().split())
P = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

count = 0

for i in range(N):
    if P[i] == min(P[:i+1]):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int,input().split()))

cnt = 0
mi = 1000000
for i in range(1,N+1):
    a = p[:i][-1]
    if  mi > a:
        cnt += 1
        mi = a 
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
count = 0
for i in range(len(P)):
  ref_list = [(j-P[i]) for j in P[:i+1]]
  if all(k>=0 for k in ref_list):
    count += 1  
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
p=input().split()
P=[int(a) for a in p]
answer=0
for a in range(N):
    if min(P[:a+1])==P[a]:
        answer+=1
print(answer)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
# = map(int, input().split())
P = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

count = 0

for i in range(N):
    if P[N-1-i] == min(P):
        count += 1
        del P[N-1-i]
    else:
        del P[N-1-i]

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

P = [int(_) for _ in input().split()]


cnt=0
for i in range(n):
    if min(P[:i+1])==P[i]:
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

P = [int(_) for _ in input().split()]

cnt=0
for i in range(n):
    judge=True
    for j in P[:i+1]:
        if P[i] > j:
            judge = False
    if judge==True:
        cnt +=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
count=1
for i in range(1,n):
    if p[i]<=min(p[:i+1]):
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
A=[]
ans=0
for i in P:
    A.append(i)
    if min(A)==i:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p_base=list(map(int,input().split()))
p={}
for i in range(1,n+1):
    p[i]=p_base[i-1]
count=0
for i in range(1,n+1):
    
    if i==1:
        count+=1
    else:
        count2=0
        for j in range(1,i):
            if p[i]>p[j]:
                count2+=1
        if count2==0:
            count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))

def check(a,list):
    if a==min(list):
        return 1
    else:
        return 0
count=0
for i in range(n):
    count+=check(p[i],p[:i+1])
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))

count=1
if n>1:
    for i in range(1,n):
        count2=0
        for j in range(0,i):
            if p[i]>p[j]:
                count2+=1
        if count2==0:
            count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:

n=int(input())
p=list(map(int,input().split()))

res=1
l=1

for i in p[1:]:
    if i<min(p[:l]):
        res+=1
    l+=1

print(res)

Submission status: Time Limit Exceeded

Solution code:

n=int(input())
p=list(map(int,input().split()))

res=0
l=0

for i in p:
    #最初の数は必ず満たす
    if l==0:
        res+=1
    elif i<min(p[:l]):
        res+=1

    l+=1

print(res)

Submission status: Time Limit Exceeded

Solution code:

n=int(input())
p=list(map(int,input().split()))

res=0
l=1
for i in p:
    if l == 1:
        res+=1
        l+=1
        continue

    for j in p[0:l]:
        if i == j:
            res+=1
        elif i>j:
            break 
    l+=1

print(res)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
ans = 0
i = 0
while n > i:
    wk = 0
    count = 0
    j = 0
    while wk == count and i >= j:
        if p[j] >= p[i]:
            wk += 1
        count += 1
        j += 1
    if wk == count:
        ans += 1
    i += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n):
    wk = 0
    count = 0
    for j in range(0,i):
        if p[j] >= p[i]:
            wk += 1
        count += 1
    if wk == count:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N=int(input())
    P=[int(_) for _ in input().split()]
    ans = 0
    for i in range(N):
        if P[i] == min(P[:i+1]):
            ans += 1
    print(ans)
main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N=int(input())
    P=[int(_) for _ in input().split()]
    ans = 0

    for i in range(1,N+1):
        flag=0
        for j in range(1,i+1):
            if P[i-1] > P[j-1]:
                flag=1
            if flag:
                continue
        ans += abs(flag-1)
    print(ans)

main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
m =[0] * n
m[0] = p[0]
for i in range(1, n):
  q = sorted(p[:i+1])
  m[i] = q[0]
ans = 0
for i in range(n):
  if p[i] == m[i]:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int, input().split()))

count = 0
for i in range(N):
  if min(P[0:i+1]) == P[i]:
#    print(i,P[i])
    count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if min(P[0:i+1]) == P[i]:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
p = list(map(int,input().split()))


cnt = 0

for i in range(n):
    now_list = p[0:i+1]
    Pi = p[i]
    Pj = min(now_list)
    #print(now_list,Pi,Pj)
    if Pi > Pj:
        cnt += 1
print(n-cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(k) for k in input().split()]

result = 0
for i in range(N):
    for j in range(0,i):
        # j < i
        if P[i] > P[j]:
            result = result - 1
            break

print(N+result)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
mem=set()
c=0
for i in range(N):
    if i > 0:
        if P[i] <= min(mem):
            c+=1
    else:
        c+=1
    mem.add(P[i])
print(c)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
Nums = list(map(int,input().split()))

M=[]

for i in range(1,N+1):
    tmp_list = Nums[:i]
    M_i = min(tmp_list)

    M.append(M_i)

cnt=0
for j in range(N):
    if Nums[j] ==M[j]:
        cnt+=1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = list(map(int, input().split()))

count = 0
for i in range(1, n+1):
  if i in set(P):
    count += 1
    P = P[:P.index(i)]
  if len(P) == 0:
    break

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
    if p[i] <= min(p[0:i+1]):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(p) for p in input().split()]
ans = 0

for i in range(N):
  if P[i] == min(P[0:i+1]) :
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(p) for p in input().split()]
out = 0

for i in range(N):
  for j in range(0, i):
    if P[i] > P[j]:
      out += 1
      break
print(N - out)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
count = [0] * n
for i in range(n):
    for j in range(i+1):
        if p[i] <= p[j]:
            count[i] = 1
        else:
            count[i] = 0
            break
print(sum(count))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 1

for i in range(1, N):
    if P[i] <= min(P[:i]):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import itertools
n = int(input())
p = list(map(int,input().split()))
li = []
count = 0
for i in range(n):
    min_p = 0
    li.append(p[i])
    for j in range(len(li)):
        min_p = min(p[i],li[j])
        if min_p != p[i]:
            break
    if min_p == p[i]:
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
#print(p)

ans = 0

#for i in range(1, n+1):
#    cnt = 0
#    for j in (1, i):
#        if p[i] <= p[j]:
#            cnt += 1
#            print(cnt)
#    if cnt == i:
#        ans += 1

for i in range(n):
    #q = p[0:i+1]
    #print(q)
    if p[i] <= min(p[0:i+1]):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
    q = p[0:i+1]
    if p[i] <= min(q):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

N = int(input().strip())
P_list = list(map(int, input().rstrip().split()))
#-----

cnt = 0
for i in range(len(P_list)):
    for j in range(i+1):
        if P_list[j] < P_list[i]:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int, input().split()))

M=[]
cnt=0
for i in range(N):
  M.append(min(A[0:i+1]))
  if A[i]<=M[i]:
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int, input().split()))

M=[]
for i in range(N):
  M.append(min(A[0:i+1]))
cnt=0
for i in range(N):
  if A[i]<=M[i]:
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int, input().split()))

cnt=0
for i in range(N):
  flag=1
  for j in range(i):
    if A[j]<A[i]:
      flag=0
      break
      #print('ng',i,j)
  else:
    #print('ok',i)
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

n = int(input())
p = np.array(list(map(int, input().split())))

ans = 1

for i in range(1, p.shape[0]):
    tmp = p[:i].copy()
    tmp = tmp - p[i]
    if tmp[:i].min() >= 0:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

n = int(input())
p = np.array(list(map(int, input().split())))

ans = 1

for i in range(1, p.shape[0]):
    tmp = p.copy()
    tmp = tmp - p[i]
    if tmp[:i+1].min() >= 0:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p= list(map(int,input().split()))
cnt=0
for k in range(n):
  if min(p[:k+1])==p[k]:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p= list(map(int,input().split()))
cnt=1
for k in range(n-1):
  tmpmin=min(p[:k+1])
  if tmpmin>=p[k+1]:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int,input().split()))

a = [min(p[:i+1]) for i in range(N)]
ans = 0
for i in range(N):
  if p[i] == a[i]:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int,input().split()))

ans=1
for i in range(1,N):
  p_min = min(p[0:i])
  if p[i] < p_min:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int,input().split()))

ans=1
for i in range(1,N):
  p_prev = sorted(p[0:i])
  if p[i] < p_prev[0]:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))

if p == sorted(p):
    print(1)
    quit()
if p == sorted(p)[::-1]:
    print(n)
    quit()
c = 0
for i in range(n):
    if p[i] == min(p[:i+1]):
        c += 1
        if p[i] == min(p):
            print(c)
            quit()
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
c = 0
for i in range(n):
    if p[i] == min(p[:i+1]):
        c += 1
        if p[i] == min(p):
            print(c)
            quit()
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
c = 0
for i in range(n):
    if p[i] == min(p[:i+1]):
        c += 1
        if p[i] == min(p):
            break
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
c = 0
for i in range(n):
    if p[i] == min(p[:i+1]):
        c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 0
for i in range(1, N+1) :
   
    m = min(P[:i])

    if P[i-1] == m :
        cnt = cnt + 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))

cnt = 0
l = []
for i in P :
    l.append(i)
    m = min(l)

    if i == m :
        cnt = cnt + 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_list = list(map(int,input().split()))
M_list = []
cnt = 0
for j in range(1,N+1):
  M_list.append(min(P_list[:j]))

for i in range(N):
  if M_list[i] == P_list[i]:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_list = list(map(int,input().split()))

cnt = 0
for i in range(1,N+1):
  M  = min(P_list[:i])
  if M == P_list[i-1]:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_list = list(map(int,input().split()))

cnt = 0
for i in range(1,N+1):
  ans_list = P_list[:i]
  ans_list.sort()
  if ans_list[0] == P_list[i-1]:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_list = list(map(int,input().split()))

cnt = 0
for i in range(1,N+1):
  ans_list = P_list[:i]
  if min(ans_list) == P_list[i-1]:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3

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

    cnt = 0
    for i in range(0, N):
        if P[i] == min(P[0:i + 1]):
            cnt += 1
    print(cnt)


main()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=[int(i) for i in input().split()]
cnt=0
for r in range(N):
    if P[r]==min(P[0:r+1]):
        cnt+=1
    else:
        continue
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = list(map(int, input().split()))
t = 0
for i in range(n):
  if min(P[:i+1]) >= P[i]:
    t += 1
print(t)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
ans = 0
ps=[]

for i in p:
    ps.append(i)
    #print(ps)
    if min(ps)>=i:
        ans+=1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
cnt = 0
for i in reversed(range(0,N)):
    if P[i]<=min(P):
        cnt +=1
    P.pop()
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(i) for i in input().split()]

cnt = 0
for i in range(n):
    min_val = min(p[:i+1])
    if min_val >= p[i]:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(0,N):
    if min(P[:i+1]) == P[i]:
        ans += 1
    else:
        continue
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    try:
        for j in range(i):
            assert(P[i] <= P[j])
        ans += 1
    except AssertionError:
        continue
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
ans = 0


for i in range(n):
    if min(p[:i+1])>=p[i]:
        ans+=1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
ans = 0
# for i in range(n):
#     count=0
#     for j in range(i+1):
#         if p[i]>p[j]:
#             break
#         else:
#             count+=1
#     if count==i+1:
#         ans+=1
# print(ans)

for i in range(n):
    l = p[:i+1]
    #print(min(l),p[i])
    if min(l)>=p[i]:
        ans+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
    count=0
    for j in range(i+1):
        if p[i]>p[j]:
            break
        else:
            count+=1
    if count==i+1:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
P = LIST()

cnt = 1
for i in range(1, N):
	if P[i] == min(P[:i+1]):
		cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())
P = list(map(int, input().split()))
P.append(0)
P = np.array(P)
ans = 1
for i in range(1,N):
  tmp = P[:i+1]
  if np.argmin(tmp) == i:
    ans +=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
count=0
P_new=[]
for index in range(N):
    P_new.append(P[index])
    P_new.sort()
    if P_new[0]==P[index]:
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
P=list(map(int,input().split()))
count=0
for index in range(N):
    P_new=P[:index+1]
    P_new.sort()
    if P_new[0]==P[index]:
        count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    count = 0
    for i in range(N):
        M = min(P[:i+1])
        if M >= P[i]:
            count += 1
    print(count)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    count = 0
    for i in range(N):
        k = True
        for j in range(i):
            if P[i] > P[j]:
                k = False
                break
        if k:
            count += 1
    print(count)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    count = 0
    for i in range(N):
        k = True
        for j in range(i):
            if P[i] > P[j]:
                k = False
                break
        if k:
            count += 1
    print(count)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
p=list(map(int,input().split()))
a=0

for i in range(N):
  if min(p[0:i+1])==p[i]:
    a+=1
print(a)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
p=list(map(int,input().split()))
a=0

b=[]
for i in range(N):
  b.append(p[i])
  if min(b)==p[i]:
    a+=1
print(a)