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())
lists = list(map(int, input().split()))

count = 0

for i in range(1, N+1):
    # print("i", i)
    cnt = 0
    for j in range(1, i+1):
        # print(i)
        # print(j)
        if lists[i-1] <= lists[j-1]:
            # print("II", i)
            cnt += 1
        else:
            continue
    if cnt == i:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

ans = 0

for k in range(N):
  # k＝０を避けるため
  s = P[0:k+1]
  min_k = min(s)
  if min_k == P[k]:
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

# 最小値の定義

ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

a = list(map(int,input().split()))[:n]

r=1
for i in range(1,n):
    if a[i] <= min(a[:i]):r+=1

print(r)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

x = int(input())
li = list(map(int, input().split()))

a = 0 # カウントする

for i in range(len(li)):
    c = 0
    j = 0
    while i >= j:
        if li[i] <=  li[j]:
            c += 1
            if c == i+1:
                a += 1
        j+=1
print(a)

Submission status: Time Limit Exceeded

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

for i in range(n):
    m= min(P[0:i+1])
    if m==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):
    Q= (P[0:i+1])
    if min(Q)==P[i]:
        ans+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(i) for i in input().split()]
c = 0
for i, pi in enumerate(p):
    if pi == 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(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()))
n=0
for i in range(N):
    if min(P[0:i+1])==P[i]:
        n+=1
print(n)

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):
        if p[j]<p[i]:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
N=int(input())
P=list(map(int,input().split()))
n,Pi=0,deque()
for i in range(N):
    Pi.append(P[i])
    if min(list(Pi))==Pi[i]:
        n+=1
print(n)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(n):
    if all(p[i] <= p[j] for j in range(i)):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
n = int(input())
l = list(map(int, input().split()))
ans = 1
if len(l) == 1:
    print(1)
    exit()
if len(l) > 1 and l[0] >= l[1]:
    ans += 1
for i in range(2, n):
    if min(l[:i]) > l[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    flag = True
    #print("i", i)
    for s in range(i):
        #print("s", s)
        if l[s] < l[i]:
            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()))
ans = 1

min_P = P[0]

for i in range(1, N):
    tmp_P = P[:i]
    if min_P >= P[i]:
        ans += 1
        min_P = P[i]

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):
    tmp_P = P[:i]
    if min(tmp_P) >= P[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):
    for t in range(i):
        if P[i] > P[t]:
            count += 1   
            break
print(N - count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int,input().split()))
new_l = []
q = 0
for i in l:
  new_l.append(i)
  a = min(new_l)
  if a==i:
    q += 1
print(q)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int,input().split()))
new_l = []
q = 0
for i in l:
  new_l.append(i)
  a = sorted(new_l)
  if a.index(i)==0:
    q += 1
print(q)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

minlist=[]
for n in range(N):
    if n==0:
        minlist.append(1)
    elif P[n]==min(P[:n+1]):
        minlist.append(1)
    else:
        pass
print(sum(minlist))

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(n):
    count = -1
    for j in range(i+1):
        if p[i] <= p[j]:
            count += 1
    if count == 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, elem in enumerate(p):
    if min(p[:i+1]) == elem:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

ans = 0
for i, j in enumerate(p):
    if i == 0:
        ans += 1
        continue
    else:
        if j < min(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, j in enumerate(p):
    if i == 0:
        ans += 1
        continue
    
    for k in p[:i]:
        if j < k:
            continue
        else:
            break
    else:
        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):
    for j in range(i+1):
        if p[i] > p[j]:
            break
    else:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = list(map(int,input().split()))
    cnt = 1
    for i in range(1, N):
        # Pi
        # P[0:i]
        Q = P[0:i]
        if P[i] > min(P[0:i]):
            cnt = cnt
        else:
            cnt += 1

        #Q = [ _ for _ in P[0:i] if P[i] <= _ ]  # TLE
        #for _ in P[0:i+1]:
        #    print(_)
        #if len(Q) == i:
        #    cnt += 1
    print(cnt)

main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = list(map(int,input().split()))
    cnt = 0
    for i in range(N):
        # Pi
        # P[0:i]
        Q = [ _ for _ in P[0:i] if P[i] <= _ ]
        #for _ in P[0:i+1]:
        #    print(_)
        if len(Q) == i:
            cnt += 1
    print(cnt)

main()

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): #i=2以降について順番に見ていく
  for j in range(0, i): #iより小さい要素について順番に見ていく
    if p[j] < p[i]: #jの方が小さかったら
      break #ダメなので抜ける
    if j == i-1: #j=i-1になったら
      ans = ans + 1 #要件を満たすので+1する
  if p[i] == 1:
    break
  
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): #i=2以降について順番に見ていく
  for j in range(0, i): #iより小さい要素について順番に見ていく
    if p[j] < p[i]: #jの方が小さかったら
      break #ダメなので抜ける
    if j == i-1: #j=i-1になったら
      ans = ans + 1 #要件を満たすので+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): #i=2以降について順番に見ていく
  for j in range(0, i+1): #iより小さい要素について順番に見ていく
    if p[j] < p[i]: #jの方が小さかったら
      break #ダメなので抜ける
    if j == i: #j=iになったら
      ans = ans + 1 #要件を満たすので+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):
    for n in range(i + 1):
        if P[n] < P[i]:
            break
        if i == n:
            count += 1
print(count)

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 n in range(i + 1):
        if P[n] < P[i]:
            flag = False
        if i == n and flag:
            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):
    p_list = list(sorted(p[:i+1])) 
    
    if p_list[0] == p[i]:
        ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# 初期入力
N = int(input())
P = list(map(int, input().split()))

#　右から１つ目と２つ目だけ比較し分岐
count =1 # 一つ目（添え字０）は必ずOK
for i in range(1,N):
    if P[i-1] < P[i]: # 増えていたら×
        #print(P[i],P[:i+1])
        continue
    elif P[i] ==min(P[:i+1]): # 減っていてかつMinならOK
        #print(P[i],P[:i+1])
        count +=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
# 初期入力
N = int(input())
P = list(map(int, input().split()))

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_n = list(map(int, input().split()))
ans = 1
p_i_1 = [p_n[0]]
for i in range(1, n):
    if min(p_i_1) > p_n[i]:
        ans += 1
    p_i_1.append(p_n[i])
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):
    a = min(p[:i])
    if a > p[i]:
        cnt += 1
print(cnt + 1)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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())
P_list = [int(i) for i in input().split()]

# cnt = 1 # 1件目は必ず合致するので

# for i in range(1,len(P_list)) :
#     pi = P_list[i]
#     is_match = True
#     for j in range(i) : # Pi==Pjは必ず正なのでジャッジ不要
#         pj = P_list[j]
#         if (pi > pj) :
#             is_match = False
#             break
    
#     if (is_match) :
#         cnt += 1

cnt = 1 # 1件目は必ず合致するので
min_map = [P_list[0]]
for i in range(1,len(P_list)) :
    # print(P_list[0:i])
    min_value = min(P_list[0:i])
    min_map.append(min_value)

# print(min_map)
for i in range(1,len(P_list)) :
    if (min_map[i] >= P_list[i]) :
        cnt += 1



print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P_list = [int(i) for i in input().split()]

cnt = 1 # 1件目は必ず合致するので
for i in range(1,len(P_list)) :
    pi = P_list[i]
    is_match = True
    for j in range(i) : # Pi==Pjは必ず正なのでジャッジ不要
        pj = P_list[j]
        if (pi > pj) :
            is_match = False
            break
    
    if (is_match) :
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = input()
p = input().split()
cnt = 0
cn = 0

for i in range(len(p)):
	cn = int(p[i])
	for j in range(i + 1):
		if cn > int(p[j]):
			break
		if i == j:
			cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = input()
p = input().split()
cnt = 0
cn = 0

for i in range(len(p)):
	cn = int(p[i])
	cp = [int(p[j]) for j in range(i+1)]
	if cn > min(cp):
		continue
	else :
		cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
	res = list(sys.stdin.readline())
	if res[-1] == "\n":
		return res[:-1]
	return res


def IR(n):
	return [I() for i in range(n)]


def LIR(n):
	return [LI() for i in range(n)]


def SR(n):
	return [S() for i in range(n)]


def LSR(n):
	return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
	n = I()
	p = LI()
	count = 0
	for i in range(1,n+1):
		flag = False
		for j in range(1,i+1):
			if p[i-1] <= p[j-1]:
				flag = True
			else:
				flag = False
				break
		if flag is True:
			count += 1
	print(count)
	return


# Solve
if __name__ == "__main__":
	solve()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i, pi in enumerate(P):
    if all([pi < pj for pj in P[:i]]):
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
l = input().split()
cnt = 0 

for i in range (N) :
    l[i] = int(l[i])

for i in range (N) :
    flag = True
    for j in range (i) :
        if (l[j] < l[i]) :
            flag = False
    if (flag) :
        cnt += 1

print (cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
numbers = list(map(int, input().split(' ')))
counter = 0

for i in range(n):
    flag = True
    for j in range(i):
        if numbers[i] > numbers[j]:
            flag = False
    if flag is True:
        counter += 1
print(counter)

Submission status: Time Limit Exceeded

Solution code:
s = [input() for _ in range(2)]
N = int(s[0])
P = s[1].split()
for i in range(N):
    P[i] = int(P[i])
P = [N+1] + P

count = -1

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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[0:i+1]):
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

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())
ls = list(map(int,input().split()))
a = 0
for i in range(n):
    for j in range(i):
        if ls[i] > ls[j]:
            a += 1
            break
        else:
            continue
print(n - a)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

ans = 0
for i in range(n):
    mi = min(pl[:i+1])
    if mi == pl[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):
  if P[i] <= min(P[: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(1, N + 1):
	for j in range(1, i + 1):
		if not P[i - 1] <= P[j - 1]:
			break
		elif i == j:
			count += 1

print(count)

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(1,n+1):
    if min(listn[:i]) >= listn[i-1]:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(1,n+1):
    if listn[i-1]==min(listn[:i]):
        ans+=1

print(ans)

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(1,n+1):
    list = listn[:i]
    if listn[i-1]==min(list):
        ans+=1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    A=[]
    for i in range(N):
        A.append(min(P[:i+1]))
    print(len(set(A)))

resolve()

Submission status: Time Limit Exceeded

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    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)

resolve()

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
input = stdin.readline
n = int(input())
pn = list(map(int, input().split()))
ans = 1
for i in range(n-1):
  if min(pn[:i+1]) >= pn[i+1]:
    ans +=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 1
flag = True
for i in range(1, N):
    for j in range(i-1, -1, -1):
        if P[j] < P[i]:
            flag = False

    if not flag:
        flag = True
    else:
        ans += 1 
print(ans)

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(1,n+1):
    list = sorted(listn[:i])
    if listn[i-1]==list[0]:
        ans+=1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力 <int> list[]
P = list(map(int, input().split()))

count = 0

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力 <int> list[]
P = list(map(int, input().split()))

count = 0

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力 <int> list[]
P = list(map(int, input().split()))

count = 0

for i in range(N):
    pi = P[0:i + 1]
    pi.sort()
    if pi[0] == P[i]:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力 <int> list[]
P = list(map(int, input().split()))

count = 0

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

# 標準入力 <int>
N = int(input())

# 標準入力 <int> list[]
P = list(map(int, input().split()))

count = 0

for i in range(N):
    isOK = True
    for j in range(i + 1):
        if P[i] > P[j]:
            isOK = False
    if isOK:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = input().split(" ")

t = 0
list = []
for i in range(N):
    list.append(int(P[i]))
    m = min(list)
    if m == int(P[i]):
        t = t + 1

print(t)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = input().split(" ")

t = 1
for i in range(1,N):
    list = []
    for j in range(i + 1):
        list.append(int(P[j]))
    m = min(list)
    if m == int(P[i]):
        t = t + 1

print(t)

Submission status: Time Limit Exceeded

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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

    cnt=0
    for i in range(N):
        if all(j >=P[i] for j in P[:i]):
            cnt+=1
    print(cnt)


resolve()

Submission status: Time Limit Exceeded

Solution code:

def main():
    
    n = int(input())
    p_list = list(map(int, input().split()))
    
    ans = 0
    for i in range(n):
        #print(p_list[:(i+1)])
        if min(p_list[:(i+1)]) >= p_list[i]:
            ans += 1
    
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
 
count = 0
now_LINE = []
 
#別パターン
for i in range(N):
    for x in range(i):
        if Line[x] < Line[i]:
            break
    else:
        count += 1


print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0
now_LINE = []

# for i in range(N):
#     now_LINE.append(Line[i])
#     for x in range(i):
#         if now_LINE[x] < Line[i]:
#             break
#     else:
#         count += 1
    
for i in range(N):
    if min(Line[0:i+1]) >= Line[i]:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0
now_LINE = []

for i in range(N):
    now_LINE.append(Line[i])
    for x in range(i):
        if now_LINE[x] < Line[i]:
            break
    else:
        count += 1
    
    # if min(now_LINE) >= Line[i]:
    #     count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0
now_LINE = []

for i in range(N):
    flag = 1
    now_LINE.append(Line[i])
    for x in range(i):
        if now_LINE[x] < Line[i]:
            flag = 0
            break
    
    if flag == 1:
        count += 1
    
    # if min(now_LINE) >= Line[i]:
    #     count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0
now_LINE = []

for i in range(N):
    flag = 1
    now_LINE.append(Line[i])
    for x in range(i):
        if now_LINE[x] < Line[i]:
            flag = 0
    
    if flag == 1:
        count += 1
    
    # if min(now_LINE) >= Line[i]:
    #     count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0
now_LINE = []

for i in range(N):
    now_LINE.append(Line[i])
    if min(now_LINE) >= Line[i]:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

count = 0


for i in range(N):
    nou_Line = Line[0:i+1]
    if min(nou_Line) >= Line[i]:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = [int(x) for x in input().split()]
ans = 1
for i in range(1,n):
    if min(li[:i+1])>=li[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 range(n):
  if all([p[i]<=p[j] for j in range(i)]):
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
c = 0

for i in numbers[::-1]:
    for j in numbers[numbers.index(i)::-1]:
        if  i <= j :
            continue
        else:
            break
    else:
        c += 1

print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
c = 0

for i in range(n)[::-1]:
    for j in range(0, i)[::-1]:
        if numbers[i] <= numbers[j]:
            continue
        else:
            break
    else:
        c += 1

print(c)

Submission status: Time Limit Exceeded

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

ans=1

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
L=list(map(int,input().split()))
tmp=[]
ans=0
for i in range (N):
	tmp.append(L[i])
	if min(tmp)==L[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):
    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):
    P1 = P[0:i+1]
    m = min(P1)
    if P[i] == m:
        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):
    P2 = P[0:i+1]
    m = min(P2)
    if P[i] <= m:
        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):
    for j in range(0,i+1):
        if P[i] > P[j]:
            break
    else:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

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

count = 0
l = []
for x in P:
	l.append(x)
	if min(l) == x:
		count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

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

count = 0
l = []
for i in range(len(P)):
	l.append(P[i])
	if min(l) == P[i]:
		count += 1

print(count)