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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def count(P):
  cnt = 0
  for i in range(N):
    min = P[i]
    for j in range(i):
      if min > P[j]:
        min = P[j]
    if min == P[i]:
      cnt += 1
        
  return cnt

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

def get_the_i(P, n):
    return np.argmin(P[:n])

i = np.argmin(P)
count = 1
while(i > 0):
    i = get_the_i(P, i)
    count += 1
    
print(count)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
List=list(map(int,input().split()))
newList =[0] * n
count = 0
for i in range(1, n + 1):
    # print(i)
    # print(List[0:i])
    # print(min(List[0:i]))
    newList[i - 1] = min(List[0:i])

# print(newList)
for j in range(n):
    if(List[j] <= newList[j]):
        count = count + 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = input()
list = list(map(int,input().split()))
count = 0
for i, val in enumerate(list):
  if min(list[0:i+1]) >= val:
    count += 1
print("%d"%(count))

Submission status: Time Limit Exceeded

Solution code:
import sys

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

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

print (answer)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(len(p)):
    if i == 0:
        ans += 1
    else:
        p_min = min(p[0:i+1])
        if p_min == p[i]:
            ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(N):
    j=0
    while j<= i and P[i]<=P[j]:
        if i!=j:
            j+=1
        else:
            ans+=1
            break
print(ans)

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

Submission status: Time Limit Exceeded

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

cnt = 0
min_p = 0

if n == 1:
    print(n)
else:
    for i in range(1, n):
        min_p = min(p[:i])

        if min_p < p[i]:
            cnt = cnt + 1
    print(n - cnt)

Submission status: Time Limit Exceeded

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

cnt = 0
min_p = 0

if n == 1:
    print(n)
else:
    for i in range(1, n):
        min_p = min(p[:i])

        if min(p[:i]) < p[i]:
            cnt = cnt + 1
    print(n - cnt)

Submission status: Time Limit Exceeded

Solution code:
n, *p_n = map(int, open(0).read().split())

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

Submission status: Time Limit Exceeded

Solution code:
n, *p_n = map(int, open(0).read().split())

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

print(count + 1)

Submission status: Time Limit Exceeded

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

# for i, p in enumerate(P):
#     subary = P[:i+1]
#     if (min(subary) >= p):
#         result += 1

for i in range(len(P)):
    subary = P[:i+1]
    if (min(subary) >= P[i]):
        result += 1

print(result)

Submission status: Time Limit Exceeded

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

for i in range(len(P)):
    subary = P[:i+1]
    if (min(subary) >= P[i]):
        result += 1

print(result)

Submission status: Time Limit Exceeded

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

for i, p in enumerate(P):
    subary = P[:i+1]
    if (min(subary) >= p):
        result += 1

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list_P = [int(x) for x in input().split()]

ans = 1

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list_P = [int(x) for x in input().split()]

ans = 1

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
list_P = [int(x) for x in input().split()]

ans = 0

for i in range(len(list_P)) :
    out = 0
    for j in range(i) :
        if list_P[i] > list_P[j] :
            out = 1
    if out == 0 :
        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 = 1
    for j in range(i):
        if P[j] < P[i]: 
            flag = 0 
            break
    if flag:
        c += 1

print(c)

Submission status: Time Limit Exceeded

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

c = 0
for i in range(N):
    flag = 1
    for j in range(i):
        if P[j] < P[i]: 
            flag = 0 
            break
    if flag > 0:
        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):
    m = min(P[: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):
  if min(p[:i+1]) == p[i]:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(n):
    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):
    if all(p[i] <= p[j] for j in range(i)):
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
permu = list(map(int,input().split()))
cnt=0
for index,num in enumerate(permu):
    if num <= min(permu[:index+1]):
        cnt+=1
    
    else:
        continue
print(cnt)

Submission status: Time Limit Exceeded

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

k = 0
for i in range(len(num_list)):
    if i != len(num_list)-1:
        if min(num_list[:i+1]) == num_list[i]:
            k += 1
    else:
        if min(num_list) == num_list[i]:
            k += 1
    
print(k)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

def main():
    N = int(input())
    P = np.array([int(x) for x in input().split()])
    ans = 0

    for i in range(N):
        if P[i] <= min(P[0:i+1]):
            ans += 1
    
    print(ans)
        
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

    print(ans)
        
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

    for i in range(N):
        flg = True
        for j in range(i+1):
            if P[i] > P[j]:
                flg = False
        if flg == True:
            ans += 1
    
    print(ans)
        
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, *P = map(int, read().split())
ans = 0
for i in range(1, len(P)+1):
    if min(P[:i]) == P[:i][-1]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

cnt=0

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

print(cnt)

Submission status: Time Limit Exceeded

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

cnt=0

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

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def main(length_num,num_list):
    count_num = 0
    for i in range(0,length_num):
        flag_tag = True
        for j in range(0 , i ):
          if int(num_list[i]) >= int(num_list[j]):
              flag_tag = False
              break
        if flag_tag != False:
            count_num += 1
    return count_num


    
if __name__ == "__main__":
    input_length_num = int(input())
    input_num2 = input()
    input_num_list = input_num2.split()
    print(main(input_length_num,input_num_list))

Submission status: Time Limit Exceeded

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

def smaller(x, y):
    if x>y:
        return y
    else:
        return x

def minimum(score):
    m = score[0]
    for i in range(1, len(score)):
        m = smaller(m, score[i])
    return m

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

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

l = []
ans = 0

for i, item in enumerate(P):
  if i==0:
    ans = 1
    l.append(item)
  else :
    if (item <= min(l)):
      ans += 1
    l.append(item)
      
print(ans)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
p = map(int, input().split())
pList = list(p)
ret = 0

for i in range(num):
    check = True
    for j in range(i):
        if pList[i] >= pList[j]:
            check = False
            break
    if check == True:
        ret = ret + 1

print("{}".format(ret))

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(N):
  a = True
  for j in range(i):
    if P[i] <= P[j]:
      a = True
    else:
      a = False
      break
  if a == True:
    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):
  pi = P[i]
  pm = min(P[:i])
  if pi <= pm:
    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()))
ans=[1]*N
flag=0
for i in range(1,N):
    if P[i]>min(P[:i]):
        ans[i]=0
print(sum(ans))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
while True:
    if len(p) == 1:
        break
    num = p.pop(-1)
    if num <= min(p):
        count += 1
print(count+1)

Submission status: Time Limit Exceeded

Solution code:
#入力
N = int(input())
li = list(map(int,input().split()))
s = 0

for i in range(N):
    if min(li[0:i+1]) == li[i]:
        s = s + 1
    else:
        s = s
print(s)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
N = input()
P = list(map(int, input().split(" ")))
count = 0
for i in range(len(P)):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        count += 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
input_num = int(input())
input_numbers = input()

numbers = input_numbers.split(" ")
integers = []

for i in numbers:
    integers.append(int(i))

ite_i = 0
ite_j = 0
result = 0
Frag = True

for i in integers:
    if (ite_i == 0):
        ite_i += 1
        result += 1
        continue

    while (ite_j < ite_i):
        if (integers[ite_j] < i):
            Frag = False
            break
        ite_j += 1

    if (Frag == True):
        result += 1
    else:
        Frag = True

    ite_i += 1
    ite_j = 0

print(result)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())

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

count = 0

for i in range(N):
	x = np.sort(data[:i+1])
	if x[0] == data[i]:
		count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = [int(x) for x in input().split()]
cnt = n
for i in range(n):
    for j in range(i):
        if p[i] <= p[j]:
            continue
        cnt -= 1
        break
print(cnt)

Submission status: Time Limit Exceeded

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

l = list()

ans = 0
for i in P:
  l.append(i)
  if all(elem >= i for elem in l):
    ans += 1
    
print(ans)

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:
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(N):
  if min(P[:i + 1]) == P[i]:
    count = count + 1

print(count)

Submission status: Time Limit Exceeded

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

count = 0

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input().strip())
ns = [int(x) for x in input().split(' ')]
cnt=0
for i in range(len(ns)):
  if ns[i] == min(ns[0:i+1]):
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
# abc152

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
[N]=list(map(int, input().split()))
A=list(map(int, input().split()))
c=0
for i in range (0,N):
    B=sorted(A[0:i+1],reverse=True)
    if B[i] == A[i]:
        c=c+1
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
# abc152
n = int(input())
lists = list(input().split())
number_list = list(map(int,lists))
ans = 0
for i in range(n):
    ans += 1
    for j in range(i):
        if number_list[j] <= number_list[i]:
            ans -= 1
            break
                
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(i) for i in input().rstrip().split(' ')]
c = 0
for i,p in enumerate(P):
    for q in P[:i+1]:
        if p > q:
           break
    else:
        c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(i) for i in input().rstrip().split(' ')]
c = 0
for i,p in enumerate(P):
    if all([p <= q for q in P[:i+1]]):
        c += 1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n, = (int(x) for x in input().split())
p = list(int(x) for x in input().split())

x = 0
for i in range(n):
    for j in range(i+1):
        if p[i] > p[j]:
            break
        if i == j:
            x += 1
print(x)

Submission status: Time Limit Exceeded

Solution code:
n, = (int(x) for x in input().split())
p = list(int(x) for x in input().split())

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
P = list(map(int, input().split()))
min_n = [min(P[:i]) for i in range(1, n+1)]
c = 0
for i in range(n):
    if P[i] == min_n[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):
    tem=0
    for j in range(0,i+1):
        if p[i]>p[j]:
            tem=0
            break
        tem+=1
    if tem>=1:
        cnt+=1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
rows = [int(s) for s in input().split()]
min_row = rows[0]
count = 0
for i in range(n):

    for j in range(i+1):
        if rows[i] <= rows[j]:
            if i == j:
                count += 1
        else:
            break

print(count)

Submission status: Time Limit Exceeded

Solution code:
def local_min(seq, i):
    m = seq[0]
    for k in range(1,i+1):
        if seq[k] < m:
            m = seq[k]
    return m


def low_elements(seq):
    count = 1
    for l in range(1, len(seq)):
        if seq[l] <= local_min(seq, l-1):
            count += 1
    return count


n = int(input())
seq1 = list(map(int, input().split()))
print(low_elements((seq1)))

Submission status: Time Limit Exceeded

Solution code:
def low_elements(seq):
    count = 0
    for i in range(len(seq)):
        count += 1
        for j in range(i):
            if seq[j] < seq[i] :
                count -= 1
                break
    return count


n = int(input())
seq1 = list(map(int, input().split()))
print(low_elements((seq1)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ps  = [int(elem) for elem in input().split()]

res = []
for i, p in enumerate(ps):
  if ps[:i] == []:
    res.append(p)
  else:
    if res[-1] > p:
      res.append(p)
print(len(res))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ps  = [int(elem) for elem in input().split()]

cnt = 0
for i, p in enumerate(ps):
  if ps[:i] == []:
    cnt += 1
  else:
    if min(ps[:i]) > p:
      cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

cnt = 0
for i in range(N):
    Flg = True
    for j in range(i+1):
        if P[j] < P[i]:
            Flg = False
            break
    if Flg:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

cnt = 0
print(len([i for i in range(N) if all([False if P[i] > P[j] else True for j in range(i)])]))

Submission status: Time Limit Exceeded

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

cnt = 0
print(len([i for i in range(N) if all([True if P[j] >= P[i] else False for j in range(i)])]))

Submission status: Time Limit Exceeded

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

cnt = 0
for i in range(N):
    Flg = True
    for j in range(i):
        if P[j] < P[i]:
            Flg = False
            break
    if Flg:
        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 all([True if P[j] >= P[i] else False for j in range(i+1)]):
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

p_temp = float("inf")

ans = N
for i in range(N):
	flag = 0
	for j in range(i):
		if p[j] <= p[i]:
			flag = 1
	ans -= flag
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
num=int(input())
line=input()
line=line.split()
count1=0
for i in range(num):
    num1=200000
    for j in range(i+1):
        if num1>=int(line[j]):
            num1=int(line[j])
    if num1==int(line[i]):
        count1+=1
print(count1)

Submission status: Time Limit Exceeded

Solution code:
num=int(input())
line=input()
line=line.split()
count=0
count1=0
for i in range(num):
    num1=int(line[i])
    for j in range(i+1):
        if num1<=int(line[j]):
            count+=1
    if count == (i+1):
        count1+=1
    count=0
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):
    for j in range(i+1):
        if p[i]>p[j]:
            break
        elif i==j:
            ans+=1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import  heapq
n = int(input())
num = [int(i) for i in input().split()]
count1 = 0

for i in range(len(num)):
    num1 = num[:i+1].copy()
    heapq.heapify(num1)
    if heapq.heappop(num1) == num[i]:
        count1 += 1
        
print(count1)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num = [int(i) for i in input().split()]
count1 = 0
count2 = 0

for i in range(len(num)):
    #print(num[:i+1],num[i])
    if min(num[:i+1]) == num[i]:
        count1 += 1
        #print(num[i])
        

print(count1)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = input()
p = list(map(int, input().split()))
ans = 0
lst = sorted(p)
pjlst = []
for i in lst:
    pjlst.append(p[i-1])
    if min(pjlst) >= p[i-1]:
        ans = ans + 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = input()
p = list(map(int, input().split()))
ans = 0
#lst = sorted(p)
#for i in lst:
for i in p:
    pjlst = p[:i]
    if min(pjlst) >= p[i-1]:
        ans = ans + 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input()
l = a.split()
for i in range(0,n):
    l[i] = int(l[i])
dp = []
for i in range(0,n+1):
    dp.append(0)
dp[0] = 1
for i in range(1,n):
    if min(l[:i+1])+1 >l[i]:
        dp[i] = dp[i-1]+1
    else:
        dp[i]=dp[i-1]
print(dp[n-1])

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    p = list(map(int, 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)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

res=0
for i in range(len(PN)):
  for j in range(i+1):
    if PN[i]>PN[j]:
      break
  else:
    res+=1
print(res)

Submission status: Time Limit Exceeded

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

if __name__== '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

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

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

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
n = int(input())
p_list = np.array(list(map(int, input().split())))
cnt = 0
for i in range(n):
  pi = p_list[i]
  if (p_list[:i] < pi).sum() == 0:  # piより前の値全てがpiより小さいとき
    cnt += 1
print(cnt)