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())
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
    elif i == j:
      cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

li=list(map(int,input().split()))
count = 0

for i in range(n-1): #iは0からn-1
  for j in range(n-i-1):
    if (li[n-i-1]>li[n-i-2-j]):
      #print("break "+str(li[n-i-1]))
      count+=1
      break
  
print(n-count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ps = list(map(int,input().split()))
count = 1
x = ps[0]
for i in range(1,len(ps)):
    if x>ps[i]:
        x = ps[i]
        mi = min(ps[0:i])
        if mi>ps[i]:
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
result = [False]*N
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if not P[i] <= P[j]:
            flag = False
            break
        elif result[i] == True:
            break
    if flag == True:
        result[i] = True
        count += 1


print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
un = []
ans = 0
for i, x in enumerate(p):
    un.append(x)
    if x <= min(un):
        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):
  if i == 0:
    ans += 1
    continue
  
  if P[i] < min(P[:i]):
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
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
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if P[i] > P[j]: 
            flag = False
            break
    if flag:
        count += 1
print(count)

Submission status: Time Limit Exceeded

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

count = 1
for i in range(1,N):
    for p in range(i):
        if P[p] < P[i]:
            break
    else:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
list=list(map(int,input().split()))
A=1
for i in range(N):
	for j in range(i+1):
		if list[i]>list[j]:
			break
		else:
			if j==i-1:
				A+=1
print(A)

Submission status: Time Limit Exceeded

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

for i in range(n):
    if i == 0:
        ans+=1
        continue

    for j in range(i):
        # print(p[i],p[j],i,j)
        if p[i] > p[j]:
            break
        elif j == i-1:
            ans+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
P_list = list(map(int,input().split()))
i_num = 0
for i in range(N):
    now_num = P_list[i]
    new_list = P_list[0:i+1]
    if now_num <= min(new_list):
        i_num += 1
    elif now_num > min(new_list):
        pass
print(i_num)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
x = P.pop(0)
m = x
ans = 1
for i in range(N-1):
    x = P.pop(0)
    if x <= m:
        ans += 1
        m = x
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

count = 0

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

print(count)

Submission status: Time Limit Exceeded

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

a = 0
for i in range(n):
  pi = p.index(i+1)
  pci = pc.index(i+1)
  if pi == pci:
    a += 1
  pc.pop(pci)
print(a)

Submission status: Time Limit Exceeded

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

counter=0
flag=True

for i in range(N):
    for j in range(i+1):

        if x[i]>x[j] and flag:
            counter+=1
            flag=False


    flag=True
print(N-counter)

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 min(P[:i])>P[i]:
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
seq = list(map(int,input().split()))
ans = 1

for i in range(1, len(seq)):
    if min(seq[0:i]) > seq[i]:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = map(int,input())
N_list = list(map(int,input().split()))
counter = 0
tmp = []
for i in range(len(N_list)):
    target = N_list[i]
    tmp.append(target)
    if min(tmp) == target:
        counter += 1
print(counter)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for j in range(N):
  count = int(0)
  for i in range(j+1):
    if P[i]>=P[j]:
      count = count + 1
  if count == j+1:
    all_count = all_count+1
    
print(all_count)

Submission status: Time Limit Exceeded

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

count = 0
for i in range(N):
  check_lis = []
  for j in range(i):
    if P_lis[i] <= P_lis[j]:
      check_lis.append(1)
    else:
      check_lis.append(0)
  if all(check_lis) == 1:
    count += 1

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):
    for j in range(i):
        if P[i] < P[j]:
            continue
        else:
            ans += 1
            break
print(len(P) - ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int, input().split()))
cnt = 0

for a,b in enumerate(lis):
    for i in range(a+1):
        if b > lis[i]:
            cnt += 1
            break
print(n-cnt)

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
from bisect import insort
n=int(input())
l=list(map(int, input().split()))
ct=0
k=[l[0]]
for i in range(1,n):
  if k[0]>l[i]:
    ct+=1
    insort(k,l[i])
  else:
    
    insort(k,l[i])
  
print(ct+1)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
array = [int(i) for i in input().split()]
s = N
for i in range (N):
  for j in  range (i):
    if array[i] > array[j]:
      s = s-1
      break
print (s)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
P = list(map(int,input().split()))
for i in range(N):
    ok = True
    for j in range(i):
        if P[i] <= P[j]:
            None
        else:
            ok = False
            break
    if ok == True:
        count += 1
print(count)

Submission status: Time Limit Exceeded

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

print(res)

Submission status: Time Limit Exceeded

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

count = 1
for i in range(1, N):
  if min(l[:i]) >= l[i]:
    count = count + 1
  else:
    pass
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int,input().split()))
count = 0
for i,l in enumerate(lis):
    if i == 0:
        count += 1
    elif l <= min(sorted(lis[0:i])):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys


def main():
    n = int(input())
    tmp = input().split(" ")
    p = []
    cnt = 0
    for i in range(n):
        p.append(int(tmp[i].replace('\n', '')))
    for i in range(n):
        flg = False
        tmp = i - 1
        for j in range(tmp + 1):
            if p[i] > p[j]:
                flg = True
                break
        if flg:
            cnt += 1
    print(n - cnt)


if __name__ == '__main__':
    input = sys.stdin.readline
    main()

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]):
    count += 1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(n) for n in input().split()]
c = 1
for i in range(1, N):
    if min(P[:i]) >= P[i]:
        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(N):
    flag = False
    for j in range(0, i):
        if P[i] <= P[j]:
            #print(":", i, P[i], P[j])
            continue
        else:
            flag = True
            break
    if flag:
        continue
    else:
        #print("::", i, P[i])
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

count = 0
for i, n in enumerate(P):
  count += 1 if all([n <= e for e in P[:i+1]]) else 0

print(count)

Submission status: Time Limit Exceeded

Solution code:
def main():
    from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]
    a = list(map(int, r.split()))
    #a, b = map(int, r.split())
    #a = [int(s[i]) for i in range(1, n+1)]
    #a = [list(map(int, r.split())) for i in range(1,n+1)]

    res = 1
    for i in range(1,len(a)):
        b = a[:i]
        if min(b) >= a[i]:
            res += 1
    print(res)

    #'Yes', 'No', 'YES', 'NO', ':(', 'Yay!'
    #res = 0
    #a, b = map(int, r.split())
    #print()

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

c = [True for i in range(n)]
for i in range(1,n):
  for j in range(i):
    if p[i]>p[j]:
      c[i] = False
      break
print(sum(c))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
check = []
for i in range(n):
    for j in range(0,i+1):
        if p[i] > p[j]:
            check.append(i)
            continue
print(n-len(set(check)))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
# C - Low Elements
import  sys

def solve152C(N, plist):
	
	count = 0
	isFound = True
	for i in range(1, N+1):
		for j in range(1, i+1):
			if plist[i-1] > plist[j-1]:
				isFound = False
				break
		if(isFound):
			count += 1
		else:
			isFound = True
					
	print(count)


if __name__ == "__main__":
	N = int(input())
	plist= list(map(int, input().split()))

	solve152C(N, plist)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, *ps = map(int, open(0).read().split())
cou = 1
for i, p in enumerate(ps[1:], 2):
  a = sorted(ps[:i])
  if a.index(p)==0:
    cou += 1
print(cou)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
    n = int(input())
    p = list(map(int, input().split(" ")))

    count = 0
    for i in range(n):
        flag = 0
        for j in range(n):
            if i > j:
                if p[i] > p[j]:
                    flag = 1
                    break
                    # print(i, j)
        if flag == 0:
            count = 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):
  sorted_p = sorted(p[:i+1])
  if sorted_p[0] == p[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 min(P[:i+1])==P[i]:
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
pl=list(map(int, input().split()))
cnt = 1
while len(pl) > 1:
    pl=pl[:pl.index(min(pl))]
    if len(pl) > 0:
        cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

cnt=0

import numpy as np

P=np.array(P)

cnt=0
for i in range(N):
    sub_list = P[:i]

    if len(sub_list)==0:
        cnt+=1
        continue

    max_P = np.min(np.sort(sub_list))

    if max_P >= P[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):
  for j in range(i+1):
    if p[i] > p[j]:
      break
    elif i == j:
      cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
n = N
for i in range(N):
  for j in range(i):
    if P[i] > P[j]:
      n -= 1
      break
    else:
      pass
print(n)

Submission status: Time Limit Exceeded

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

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 21:01:18 2020

@author: over-
"""

N=int(input())
P=input().split()

c=1
for i in range(1,N):
    bool=True
    for j in range(i):
        if int(P[i])>int(P[j]): 
            bool=False
            break
    if bool: c+=1

print(c)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=input().split()
flag=2*10**5+1
ans=0
for i in range(1,(n+1)):
    idx=p.index(str(i))
    if flag>idx:
        ans+=1
        flag=idx
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input().strip())
P = list(map(int, input().strip().split()))
ans = 0
for i in range(N):
  flag = True
  for j in range(0, i):
    if P[i] > P[j]:
      flag = False
      break
  if flag:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
x=0
for s in range(n):
  for t in range(s+1):
    if p[s]>p[s-t]:
      x+=1
      break
print(n-x)

Submission status: Time Limit Exceeded

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

count = N

for i in range(N):
    for j in range(i):
        if P[i] > P[j]:
            count -= 1
            break

print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
seq = list(map(int,input().split()))
ans = 1

for i in range(1, len(seq)):
    if seq[i] <= n - i + 2:
        for j in range(0, i+1):
            if seq[j]<seq[i]:
                break
            if j==i:
                ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

n = 0
for i in range(N):
  for j in range(0,i+1):
    #print(a[i],end=","),print(a[j])
    if a[i] > a[j]:
      #print("error")
      n += 1
      break

  
print(N-n)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(s) for s in input().split()]
count = 0
for a in range(n):
     i = p[a]
     s = p[0:(a+1)]
     if min(s)>=i:
         count+=1
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):
  flag = 1
  for j in range(i):
    if P[i] > P[j]:
      flag = 0
      break
  if flag == 1:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())
ll=[]
ll = list(map(int, input().split()))

num =0
for i in range(N):
  for j in range(i):
    if ll[i] <= ll[j]:
      pass
    else:
      num += 1
      break

print(N-num)

Submission status: Time Limit Exceeded

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

print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
count = 0
P = list(map(int,input().split()))
list = [True]*N
for i in range(N):
    for j in range(i):
        if P[i] <= P[j]:
            None
        else:
            list[i] = False
            break
print(list.count(True))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

res = 0

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

nums = []
for i in range(N):
    num = p[i]
    nums.append(num)
    flag = True
    for j in nums:
        if num > j:
            flag = False
            break
    if flag == True:
        res += 1

print(res)

Submission status: Time Limit Exceeded

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

    print(n - count)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 1
for i in range(1,n-1):
  if min(pList[:i]) >= pList[i]:
    count += 1

if len(pList) != 1:
    if min(pList[:-1]) >= pList[-1]:
      count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ps = list(map(int,input().split()))
count = 1
for i in range(len(ps)):
    if i != 0:
        x = ps[i]
        mi = min(ps[0:i])
        if mi>ps[i]:
            count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(len(p)):
    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()))

ans = 1 #i=1は絶対満たす
for i in range(1,n):
    if p[i] == min(p[:(i+1)]):
        ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int, input().split()))
count = 0
minn = lis[0]
flug = 0
for i in range(n):
    if flug == 0:
        newlis = lis[0:i+1]
        if  minn >= lis[i]:
            count += 1
            minn = lis[i]
            if minn == 1:
                count += lis[i+1:].count(1)
                flug = 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(len(P)):
  cnt += 1
  for j in range(i):
    if P[i] > P[j]:
      cnt -= 1
      break

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
if __name__ == '__main__':
    n = int(input())
    p = list(map(int, input().split(" ")))

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

    print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
isBigger = True

for i in range(len(P)):
	for j in range(i):
		isBigger = True
		if not (P[i] <= P[j]):
			isBigger = False
			break
	if isBigger:
		count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=1

for i in range(N-1):
  for k in range(i+1):
    if a[i+1]>a[k]:
      break
    if k==i:
      b+=1
print(b)

Submission status: Time Limit Exceeded

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

c=0
for i in range(n):
  s=p[0:i+1]
  s.sort()
  if s[0]==p[i]:
    c=c+1
    
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

ans = 0

for i in range(N):
  if i == 0:
    ans += 1
    continue
    
  true = 1
  for j in range(i):
    if P[i] > P[j]:
      true = 0
      break
  
  if true == 1:
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
    
def main():
    N = int(input())
    P = list(map(int, input().split()))
    
    count = 0
    for i in range(N):
        flag = True
        for j in range(i):
            if P[i] > P[j]: 
                flag = False
                break

        if flag:
            count += 1
    print(count)
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = input().rstrip().split()
ans = 0
p = [0]*N
for i in range(N):
  p[i] = int(a[i])
for i in range(N):
  if i == 0:
    ans += 1
  else:
    Plus = True
    for i2 in range(i):
      if p[i2] <= p[i]:
        Plus = False
    if Plus == True:
      ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
P_list = np.array([int(i) for i in input().split()])

# N = 5
# P_list = np.array([4, 2, 5, 1, 3])

# N = 1
# P_list = np.array([1])
# N = 8
# P_list = np.array([7 ,4 ,2 ,6 ,8 ,1 ,3])

count = 0
for i, p in enumerate(P_list, start=1):
    if np.all(P_list[:i] >= p):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:

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

count = 0

for i, value in enumerate(P):

    if i == 0:
        count += 1
        continue

    elif min(P[:i]) >= value:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

for i in range(N):
  flag = True
  for j in range(i):
    if(P[i] > P[j]):
      flag = False
      break
  if(flag):
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=1
for i in range(N-1):
	if min(a[:i+2])==a[i+1]:
		b+=1
print(b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
if __name__=="__main__":
    n = int(input())
    args = input().split()
    p = []
    for i in range(len(args)):
        p.append(int(args[i]))

    cnt = 1
    p_pre = [p[0]]
    for i in range(1,len(args)):
        p_pre.append(p[i])
        if p[i]==min(p_pre):
            cnt += 1

    print(cnt)

Submission status: Time Limit Exceeded

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

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

print(res)

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
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
answer = 0
for i in range(N):
    key = 1
    for j in range(i):
        # key = 1
        if P[i] > P[j]:
            key *= 0
        # print(P[i],P[j], key, answer)

    if key:
        answer += 1

print(answer)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
for i in range(n):
  a = p[i]
  alist = p[:i+1]
  alist.sort()
  if alist[0] == a:
    count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = [n for n in map(int,input().split())]
res = 1 #一つ目はどれよりも”大きい”
k = 0
for i in range(1,N):
    if min(L[0:i+1]) == L[i]:
        res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = list(map(int, input().split()))
    
    count = 0
    for i in range(N):
        flag = True
        for j in range(i):
            if P[i] > P[j]: 
                flag = False
                break

        if flag:
            count += 1
    print(count)
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

c = 0
for i in range(n):
    can = True
    for j in range(0, i):
        if A[i] > A[j]:
            can = False
            break
    #if can: print(i)
    if can: c+=1

print(c)

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:
n=int(input())
l=list(map(int,input().split()))
f={}
x=1
for i in range(n):
    f[x]=l[i]
    x+=1
    
ans=0   
for i in range(n):
    flag=1
    for j in range(i):
        if l[i]>l[j]:
            flag=0
    if flag:
        ans+=1
        
print(ans)

Submission status: Time Limit Exceeded

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

A = 0

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=[]*n
p=list(map(int,input().split()))
cnt=0
for i in range(n):

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int,input().split()))
count = 0
for i,l in enumerate(lis):
    if i == 0:
        count += 1
    elif l <= min(lis[0:i]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

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

  if count==i:
    count1+=1
print(count1)

Submission status: Time Limit Exceeded

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

ans = 0

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