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=input().split()
num=0
for i in range(n):
    for j in range(i+1):
        if int(p[j])<int(p[i]):
            break
        if j==i:
            num+=1
print(num)

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    P_list = list(map(int, input().split()))
 
    answer = 0
 
    for i in range(1, len(P_list)+1):
        min_P_list_form_i = min(P_list[0:i])

        if P_list[i-1] <=min_P_list_form_i:
            answer += 1
 
    print(answer)
 
 
if __name__ == "__main__":
    resolve()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
result = len(P)
for i in range(1, N):
    m = sorted(P[:i])
    if m[0] < P[i]:
        result -= 1
print(result)

Submission status: Time Limit Exceeded

Solution code:
from copy import copy
N = int(input())
P = list(map(int, input().split()))
result = copy(P)
for i in range(1, N):
    m = sorted(P[:i])
    if m[0] < P[i]:
        result.remove(P[i])
print(len(result))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
result = N
for i in range(N):
    s = P[i]
    for j in range(i):
        if P[j] < s:
            result -= 1
            break
print(result)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split(" ")))
s = 1
for i in range(1,N):
    P_S = sorted(P[:i], reverse=True)
    if P_S[i-1] >= P[i]:
        s+=1
    else:
        continue

print(s)

Submission status: Time Limit Exceeded

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

cnt = 0
for n in p:
  i = p.index(n)
  if n == p[0]:
    cnt += 1
  elif min(p[:i]) >= n:
    cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    a = input()
    l = list(map(int,input().split()))
    ans = check(int(a),l)
    print(ans)

def check(a,l):
    num = 0
    for i in range(a):
        for j in range(i):
            if l[i] > l[j]:
                break
        else:
            num = num + 1
    return num

main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    a = input()
    if int(a) > 100000:
        exit
    l = list(map(int,input().split()))
    if len(l) > int(a):
        exit
    ans = check(int(a),l)
    print(ans)

def check(a,l):
    num = 0
    for i in range(a):
        for j in range(i):
            if l[i] > l[j]:
                break
        else:
            num = num + 1
    return num

main()

Submission status: Time Limit Exceeded

Solution code:
#!python3.4.3

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

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

Submission status: Time Limit Exceeded

Solution code:
#!python3.4.3

n = int(input())
p_list = list(map(int, input().split(' ')))
count = n

for i in range(n):
    for j in range(i):
        if p_list[i] <= p_list[j]:
            continue
        else:
            count -= 1
            break
        
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = 0
for x in range(len(a)):
    c = 0
    for y in range (x):
       if a[y] < a[x]:
           c +=1
    if c == 0:
        b+=1
print(b)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(N):
    if P[i] <= min(P[0: i + 1]):
        answer.append(i)
print(len(answer))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in range(0, n):
  t = 0
  for j in range(0, i):
    if int(ar[i]) > int(ar[j]):
    	t = 1;
  if t == 0:
    c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in range(0, n):
  t = 0
  for j in range(0, i):
    if int(ar[i]) <= int(ar[j]):
    	t += 1
  if t == i:
    c += 1
print(c)

Submission status: Time Limit Exceeded

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

for i in range(N):
    count = 0
    for j in range(i + 1):
        if P[i] <= P[j]:
            count += 1
    if count == i + 1:
        answer.append(i)
print(len(answer))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
arr = input().split(' ')
arr = [int(i) for i in arr]
count = 0
for idx in range(n):
  num = arr[idx]
  comp = min(arr[:idx+1])
  if num <= comp:
    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(0, N):
    for j in range(0, i+1):
        if P[i] > P[j]:
            break
        elif j == i:
            count += 1

print(count)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

c=1

for i in range (N-1):
    Q = P[0:i+2]
    if P[i+1] <= min (Q):
        c=c+1
    else:
        c=c
   
print (c)

Submission status: Time Limit Exceeded

Solution code:
inp1 = input()
inp2 = input().split()

a = int(inp1)
#b = np.array(inp2).astype(int)
b = [int(s) for s in inp2]
ansno = a

for ii,i in enumerate(b):
  bslice = b[:ii+1]
  minb = min(bslice)
  if minb == i:
    pass
  else:
    ansno -=1

print(ansno)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
inp1 = input()
inp2 = input().split()

a = int(inp1)
b = np.array(inp2).astype(int)
ansno = a

for ii,i in enumerate(b):
  bslice = b[:ii+1]
  minb = np.min(bslice)
  if minb == i:
    pass
  else:
    ansno -=1

print(ansno)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
inp1 = input().split()
inp2 = input().split()

a = int(inp1[0])
b = np.array(inp2).astype(int)
ansno = a
maxno = b[0]

for ii,i in enumerate(b):
  bslice = b[:ii+1]
  minb = np.min(bslice)
  if minb != i:
    ansno -=1
  
print(ansno)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
inp1 = input().split()
inp2 = input().split()

a = int(inp1[0])
b = np.array(inp2).astype(int)
ansno = a
maxno = b[0]

ii = 0
for i in b:
  bslice = b[:ii+1]
  if min(bslice) != i:
    ansno -=1
  ii+=1
print(ansno)

Submission status: Time Limit Exceeded

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

for i in range(len(P)):
    a =0
    for j in range(i+1):
        if P[i]-P[j] > 0:
            a +=1
    if a == 0:
        b +=1

print(b)

Submission status: Time Limit Exceeded

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

cnt = 0             # 出力の個数
check_list = []     # 比較用リスト

# 比較用リストに一つずつ値をセット
for i in input_v_list:
    check_list.append(i)
    min_var = min(check_list)
    # i <= min のとき個数をカウント
    if(i <= min_var):
        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[:i+1]):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Ps = list(map(int,input().split()))
ans = 0
for n in range(1,N+1):
    if n == 1:
        ans +=1
    elif Ps[n-1] == min(Ps[:n]):
        ans += 1
    else:
        pass
print(ans)

Submission status: Time Limit Exceeded

Solution code:
inp1 = input().split()
inp2 = input().split()
a = int(inp1[0])
b = inp2
b = [int(s) for s in inp2]
ansno = a
maxno = b[0]

ii = 0
for i in b:
  if ii ==0:
    ii+=1
    continue
  bslice = b[:ii+1]
#  print(ii)
#  print(bslice)
  if min(bslice) != i:
#    print("min(bslice)",min(bslice)," i ",i)
    ansno -=1
  ii+=1
#  print("ansno: ",ansno)
print(ansno)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    counter = 1
    for i in range(1,N):
        if arr[i] == min(arr[0:i+1]):
            counter += 1
    print(counter)

if __name__ == "__main__":
    resolve()

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    counter = 1
    for i,j in enumerate(arr):
        if i >0 and j == min(arr[0:i+1]):
            counter += 1
    print(counter)

if __name__ == "__main__":
    resolve()

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    counter = 0
    for i,num in enumerate(arr):
        for j in range(i):
            if num > arr[j]:
                counter +=1
                break
    print(N-counter)

if __name__ == "__main__":
    resolve()

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    count = n

    for i in range(1,n+1):
        for j in range(1,i):
            if num_list[i-1] > num_list[j-1]:
                count -= 1
                break

    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
cnt = int(input())
numli = list(map(int, input().split()))
ans = 0
for i in range(1, cnt+1):
  tmpli = numli[0:i]
  target = tmpli[len(tmpli) - 1]
  tmpmin = min(tmpli)  
  if target == tmpmin:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

num = 0
for base in range(N):
    flag = 0
    for n in range(base):
        if P[n] < P[base]:
            flag = 1
    if flag == 1:
        num = num+1
        
print(N-num)

Submission status: Time Limit Exceeded

Solution code:
cnt = int(input())
numli = list(map(int, input().split()))
ans = 0
for nidx, n in enumerate(numli):
  tmp = 0
  for midx, m in enumerate(numli):
    if nidx < midx:
      break
    else:
      if m >= n:
        tmp += 1
  if tmp == nidx + 1:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range (1,N):
  if (A[i-1] > A[i]):
    ans = ans + 1
  elif (P[i] <= A[i-1]):
    ans = ans + 1
print(ans)

Submission status: Time Limit Exceeded

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

count = 0
min = 0
for i in range(num):
  min = a[i]
  for j in range(i):
    if min > a[j]:
      min = a[j]
  if min == a[i]:
    count += 1
print(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[0:i+1]):
    ans = ans + 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def pred(i, lst, offset):
  for cmpd in lst[offset:i+1]:
    if lst[i] > cmpd:
      return False
  return True

n = int(input())
p = [int(m) for m in input().split(' ')]

sum = 0
offset = 0
for i in range(n):
  if pred(i, p, offset):
    sum += 1
    offset = i

print(sum)

Submission status: Time Limit Exceeded

Solution code:
def pred(i, lst):
  for cmpd in lst[:i+1]:
    if lst[i] > cmpd:
      return False
  return True

n = int(input())
p = [int(m) for m in input().split(' ')]

sum = 0
for i in range(n):
  if pred(i, p):
    sum += 1

print(sum)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
x = list(map(int,input().split()))
count = 1
for i in range(1,N):
	flag = 1
	for j in range(i):
		if x[i] > x[j]:
			flag = 0
			break
	if flag == 1:
		count = 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):
  if p[i] == min(p[:i+1]):
    #print(p[i])
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=[]
d=0
for i in range(a):
  c.append(b[i])
  if min(c)>=b[i]:
    d+=1
  else:
    pass
print(d)

Submission status: Time Limit Exceeded

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

flg_min = p[0]
ans = 1
for i in range(1, n + 1):
    temp = p[:i]
    min_temp = min(temp)
    if flg_min > min_temp:
        ans += 1
        flg_min = min_temp

print(ans)

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)
	if i == min(l):
		cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

counter = 1

for i in range(2, len(P) + 1, 1):
    l = sorted(P[slice(i)])
    b = l[0]
    if b >= P[i-1]:
        counter += 1
    else:
        pass

# for i in range(2, len(P) + 1, 1):
#     sl = slice(i)
#     # print(P[sl])
#     # print(P[i-1])
#     if all(elem >= P[i-1] for elem in P[sl]):
#         counter += 1

print(counter)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

counter = 1

for i in range(2, len(P) + 1, 1):
    sl = slice(i)
    if min(P[sl]) >= P[i-1]:
        counter += 1
    else:
        pass

# for i in range(2, len(P) + 1, 1):
#     sl = slice(i)
#     # print(P[sl])
#     # print(P[i-1])
#     if all(elem >= P[i-1] for elem in P[sl]):
#         counter += 1

print(counter)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = 0

for index, p in enumerate(P):
  flag = 0

  for i in range(index):
    if p > P[i]:
      flag = 1

  if flag == 0:
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

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

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

Q = sorted(P,key=P.index,reverse=True)

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

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
[n] = map(int, input().split())
[*p_list] = map(int, input().split())

count = 0

for i,p in enumerate(p_list):
  s_p = p_list[:i+1]
  if min(s_p) == p:
    count += 1

print(count)

Submission status: Time Limit Exceeded

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

ans = 1
tmp = [p[0]]
for i in range(1, n):
    tmp.append(p[i])
    tmp.sort()
    if p[i] <= tmp[0]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]

"""
ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)
"""

"""
ans = 1
for i in range(1, n):
    tmp = []
    for j in range(i):
        tmp.append(p[j])
    tmp.sort()
    #print(tmp)
    if p[i] <= tmp[0]:
        ans += 1
print(ans)
"""

ans = 1
tmp = [p[0]]
for i in range(1, n):
    tmp.append(p[i])
    tmp.sort()
    if p[i] <= tmp[0]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
p = [int(i) for i in input().split()]
"""
ans = 0
for i in range(n):
    tmp = 0
    for j in range(i):
        if p[j] >= p[i]:
            tmp += 1
    if tmp == i:
        ans += 1
print(ans)
"""
ans = 1
for i in range(1, n):
    tmp = []
    for j in range(i):
        tmp.append(p[j])
    tmp.sort()
    #print(tmp)
    if p[i] <= tmp[0]:
        ans += 1
print(ans)

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 p[i] <= (min(p[0:i]) if i != 0 else p[0]):
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = 1
    for i in range(1,N):
        czy_prawda = True
        j = i - 1
        while j >= 0:
            if P[i] > P[j]:
                czy_prawda = False
                j -= 1
                break
            else: 
                j -= 1
        if czy_prawda:
            odp += 1 
    print(odp)
    
mniejsze_elementy()

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):
    flg = True
    for j in range(i):
        if not p[i] <= p[j]:
            flg = False
    count += flg
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=list(map(int,input().split()))
l=[]
for i in range(n):
  l.append(i+1)
if p[0]==1:
  print(1)
else:
  ans=0
  k=l.index(1)
  for i in range(n):
    if p[n-i-1]==l[0]:
      ans+=1
      l.remove(l[0])
    else:
      l.remove(p[n-i-1])
  print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

l_test = [0]*N

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

out = 0
n = 0
while n < N:
    l_slice = l_test[0:n+1]
    a = min(l_slice)
    if a == l_test[n]:
        out += 1
    n += 1
print(out)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import sys

count=0
N=int(sys.stdin.readline().rstrip())
P=[int(i) for i in sys.stdin.readline().split()]
for i in range(0,N):
  if np.min(P[0:i+1])==P[i]:
    count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = input().split()
ans = []
i = 1
for P_i in P:
    count = 0
    for j in range(0,i):
        if int(P_i) <= int(P[j]):
            count += 1
    if count == i:
        ans.append(int(P_i))
    i += 1
print (len(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    pi = li[i]
    for i in range(i + 1):
        if pi > li[i]:
            break
    if pi <= li[i]:
        icount += 1
print(icount)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    pi = li[i]
    for i in range(i + 1):
        if pi > li[i]:
            break
    if pi <= li[i]:
        icount += 1
print(icount)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
an = [int(i) for i in input().split()]
lowe, an_sub = 0, []
for i in range(0, n):
    an_sub = an[0:i + 1]
    if an_sub[i] <= min(an_sub):
        lowe += 1
print(lowe)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())
P = list(map(int, input().split()))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
count=0
N=int(input())
P=[int(i) for i in input().split()]
for i in range(0,N):
  for j in range(0,i+1):
    if P[j]<P[i]:
      break
    if j==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):
    if min(p[0:i+1]) >= 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):
    if min(P[:i+1])>=P[i]:
        count+=1
    else:
        pass
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(i) for i in input().split()]
ans = {}
for i in range(N):
    flag = 0
    try:
        i_min = min(P[:i])
    except:
        ans[i] = 0
        continue
    if P[i] <= i_min:
        #print(P[i], i_max)
        ans[i] = 0
    
    #if not flag:
    #    ans += 1
#print(ans.keys())
print(len(ans.keys()))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
num = P.index(min(P))+1

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = input()
P_list = input().split()
# N = '5'
# P_list = '4 2 5 1 3'.split()
P_list = [int(i) for i in P_list]
length = int(N)
ans = 0 
M = []
for i in range(length):
    # print(min(P_list[0:i+1]))
    if P_list[i]==min(P_list[0:i+1]):
        ans +=1
    
print(ans)

Submission status: Time Limit Exceeded

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

c = 0
try:
    while P:
        p_i = P.pop()
        if p_i <= min(P):
            c += 1
except ValueError:
    print(c + 1)

Submission status: Time Limit Exceeded

Solution code:
import itertools

N = int(input())
P = input().split()
Q = P.copy()
c = []
cont = False
for i, j in itertools.product(P, Q):
  i = int(i)
  j = int(j)
  if 1 <= j and j <= i:
    if (int(P[i-1]) > int(Q[j-1])):
      c.append(i)
      continue
print(len(P) - len(set(c)))

Submission status: Time Limit Exceeded

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

counter=0
for i in range(N):
  Pj_list=[]
  for j in range(i+1):
    Pj_list.append(List[j])
  Mi=min(Pj_list)
  if Mi==List[i]:
    counter+=1
print(counter)

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
  M = min(P[:i])
  if M == P[i-1]:
    cnt += 1
  if num == M:
    break
    
cnt_2 = P.count(num)
    
print(cnt+cnt_2-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[:i+1]):
    cnt+=1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = input()
P_list = input().split()
# N = '5'
# P_list = '4 2 5 1 3'.split()
P_list = [int(i) for i in P_list]
length = len(P_list)
ans = 0 
M = []
for i in range(length):
    # print(min(P_list[0:i+1]))
    if P_list[i]==min(P_list[0:i+1]):
        ans +=1
    
print(ans)

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
  a = P.index(min(P[:i]))
  if i == a+1:
    cnt += 1
  if num == min(P[:i]):
    break
    
cnt_2 = P.count(num)
    
print(cnt+cnt_2-1)

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()))
 
m=0
for i in range(1,N+1):
    a=min(p[:i])
    if a==p[i-1]:
        m+=1
 
print(m)

Submission status: Time Limit Exceeded

Solution code:
N = input()
P_list = input().split()
# N = '5'
# P_list = '4 2 5 1 3'.split()
P_list = [int(i) for i in P_list]
length = len(P_list)
ans = 0 
M = []
for i in range(length):
    # print(min(P_list[0:i+1]))
    M.append(min(P_list[0:i+1]))
for i in range(length ):
    if P_list[i]==M[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 min(P[:i+1])==P[i]:
        ans+=1
    else:
        ans+=0
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
# P = np.array(input().split(' '), dtype = int)
P = list(map(int, input().split(' ')))

ar_bool = [(min(P[:i+1]) == P[i]) for i in range(N)]
print(sum(ar_bool))

Submission status: Time Limit Exceeded

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

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:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0

for i in range(1,N+1):
  a = P.index(min(P[:i]))
  if i == a+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()))

value = np.array(P)

ac = [v for i, v in enumerate(P) if v == np.minimum.accumulate(P)[i]]

print(len(ac))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
count = 0
m = [0] * n

for i in range(1, n+1):
    m[i-1] = min(p[:i])

for i in range(1, n+1):
    if p[i-1] <= m[i-1]:
        count += 1

print(count)