Problem:


Score : 300 points

Problem Statement

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

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

Constraints

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

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

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
P_1 ... P_N

Output

Print the number of integers i that satisfy the condition.

Sample Input 1

5
4 2 5 1 3

Sample Output 1

3

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

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

Sample Input 2

4
4 3 2 1

Sample Output 2

4

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

Sample Input 3

6
1 2 3 4 5 6

Sample Output 3

1

Only i=1 satisfies the condition.

Sample Input 4

8
5 7 4 2 6 8 1 3

Sample Output 4

4

Sample Input 5

1
1

Sample Output 5

1



Sample input:
5
4 2 5 1 3


Sample output:
3

Submission status: Time Limit Exceeded

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

c = 1
if p_list == sorted(p_list):
    print(1)
    #print("if")
elif p_list == sorted(p_list, reverse=True):
    print(len(p_list))
    #print("elif")
else:
    for i in range(N):
        temp = 0
        for j in range(i):
            if p_list[i] <= p_list[j]:
                temp += 1
                if temp == i:
                    c += 1
            else:
                break
    print(c)
    #print("else")

Submission status: Time Limit Exceeded

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

memo = [0] * N
memo[0] = 1
for i in range(1, N):
    if P[i] > P[i-1]:
        memo[i] = 0
    elif P[i] > P[i-1]:
        memo[i] = memo[i-1]
    else:
        c = 1
        for j in range(i+1):
            if P[i] <= P[j]:
                c *= 1
            else:
                c *= 0
        memo[i] = c
print(sum(memo))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=[int(i) for i in input().split()]
l=len(p)
ans=0
for i in range(n):
    for j in range(i+1,n+1):
            try:
                if p[i]==0:
                    break
                if p[i]<p[j]:
                    p[j]=0
                    continue
            except IndexError:
                break
print(l-p.count(0))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

count_ans = 0

for n_ in range(n):
    count = 0
    for p_n in input_p[:n_+1]:
        if input_p[n_] <= p_n:
            count += 1
        if count == n_+1:
            count_ans += 1
print(count_ans)

Submission status: Time Limit Exceeded

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

resultCount = 0
NGNum = float('inf')
for i in range(N):
    isMitasu = True
    # 計算量削減のため、既に駄目だと分かっている数の場合計算しない
    if P[i] < NGNum:
        for j in range(i):
            if P[i] > P[j]:
                isMitasu = False
                # 計算量削減のため、駄目だった数を控える
                if P[i] < NGNum:
                    NGNum = P[i]
                break
    else:
        isMitasu = False
    if isMitasu:
        resultCount += 1
print(resultCount)

Submission status: Time Limit Exceeded

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

m = 0

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

print(m)

Submission status: Time Limit Exceeded

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

counter = {"check": 0}
for i in range(0,N):

    count = len([j for j in range(i) if  num_list[j] < num_list[i]])
    if count == 0:
        counter["check"] += 1

print(counter["check"])

Submission status: Time Limit Exceeded

Solution code:
#C - Low Elements
N = int(input())
P = list(map(int, input().split()))

x = N
ans=0
while x >=1:
    P = P[0:x]
    m=min(P)
    x=P.index(m)
    ans=ans+1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = input()
arr = list(map(int, input().split()))
c= 1
a = []
for i in range(1,len(arr)):
    a = arr[0:i]
    a.append(arr[i])
    if arr[i] == sorted(a)[0]:
        c +=1
print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
cnt=1
for i in range(1,n):
  j = i-1;flag=0
  #print(i)
  while j>=0:
    if a[i]>a[j]:
      flag=1
      break
    j-=1
  if flag==0:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
num = list(map(int,input().split()))
cnt = 0
flag = False
for i in range(N):
	if(i == 0):
		cnt+=1
		continue
	sub = num[0:i]
	sub_min = min(sub)
	if (num[i] <= sub_min):
		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):
  if not any([ P[i] >= j for j in P[:i]]):
    count += 1
print(count)

Submission status: Time Limit Exceeded

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

while i>0:
  a=a[0:a.index(min(a))]
  b+=1
  i=len(a)
print(b)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)

Submission status: Time Limit Exceeded

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

ans=1
s={num[0]}
st=set()
for i in range(1,n):
  #print(s)
  if set(list(range(1,num[i]))) & s == st:
    ans+=1
  s.add(num[i])
#print(set(list(range(8))))
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = tuple(map(int,input().split()))
    a = 0
    for i in range(N):
        hantei = 0
        for j in range(i):
            if P[i] > P[j]:
                hantei = 1
                break
        if hantei == 0:
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

for i in range(1, len(p)):
    for j in range(i):
        if p[j] < p[i]:
            flag = 1
            continue
    if flag == 0:
        count += 1
        flag = 0
    else:
        flag = 0
        continue
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
for i in range(0,N):
    P_i = P[i]
    sub_count = 0
    for j in range(0,i + 1):
        P_j = P[j]
        if P_i <= P_j:
            sub_count += 1
        
    if (i + 1) == sub_count:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

j = 0
count = 0
good = 0

for i in range(N):
    while j <= i:
        if int_list[i] <= int_list[j]:
            if i == j and j == count:
                good += 1
            count += 1
            j += 1
        else:
            j += 1
            continue
    j = 0
    count = 0

print(good)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
P=list(map(int,input().split()))
count=1
m=0
for i in range(1,n):
    m=min(P[i],1000000000)
    if P[i]>m:
        continue
    for j in range(i):
        if P[j]<P[i]:
            break
        if j==i-1:    
            count+=1
print(count)

Submission status: Time Limit Exceeded

Solution code:
x=int(input())
y=list(range(x))
y=list(map(int,input().split()))
c=0
d=True
for i in range(0,x):
  for l in range(0,i+1):
    if y[l]<y[i]:
      d=False
      break
  if d==True:
    c+=1
  else:
    d=True
print(c)

Submission status: Time Limit Exceeded

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

print(count+1)

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

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

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

count = 0

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

print(count)

Submission status: Time Limit Exceeded

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

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

print(num)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N=int(input())
PP=np.array(input().split(),dtype=np.int64)
#print(PP[3])
count=1
if (N==1):
    print(count)
else:
    for i in range(1,N):
 #       print(i)
        P1=PP[0:i+1]
        #P1=np.array(P0)
        MIN=np.min(P1)

        TAR=P1[i]
        if (MIN==TAR):
            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[:i+1])==P[i]:
        ans+=1
    else:
        ans+=0
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):
  cnt_j = 0
  cnt_j = sum([1 for j in range(i+1) if p[i] <= p[j]])
  if cnt_j == i+1:
    cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

j = 1
for i in range(1,N):
  sort_list = sorted(p_list[0:i+1])
  if p_list[i] <= sort_list[0]:
    j = j + 1

print(j)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

counta = 0
for i in range(N):
    counta += np.all((P >= P[i])[:i+1])
print(counta)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


flag = True
result=0

for pp in p:
    buf=p[0:pp]
    if min(buf)==p[pp-1]:
        result+=1
        
print(result)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


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

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

for i in range(0, N):
    array2 = list(array[0:i+1])
    array2.sort()
    if array2[0] == array[i]:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import bisect

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

    ans = 0
    first = P[0]-1

    while len(P) != 0:
        ans += 1
        m = min(P)
        if m == first:
            ans+=1
            break
        i = P.index(m)
        P = P[0:i]



    print(ans)

    return 0

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

i_ok_count=0
break_flag=0
for i in range(len(List)):
  for j in range(i):
    if List[i]>List[j]:
      break_flag=1
      break
  if break_flag==1:
    break_flag=0
    continue
  i_ok_count+=1
  break_flag=0

print(i_ok_count)

Submission status: Time Limit Exceeded

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

m = 0

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

print(m)

Submission status: Time Limit Exceeded

Solution code:
import sys

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

n=int(input())
p=list(map(int,input().split()))
P=[]
cnt=0

for i in p:
    P.append(i)
    if i==min(P):
        cnt+=1

print(cnt)

Submission status: Time Limit Exceeded

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

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

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

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
List = list(map(int, input().split()))
count = 0

for i in range(n):
  for j in range(i+1):
    if List[i] > List[j]:
      break
    if i == j:
      count += 1
print(count)

Submission status: Time Limit Exceeded

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    n = int(lines[0])
    p = [int(e) for e in lines[1].split(' ')]

    return (n, p)


def solve(n, p):


    result = [] 
    current_min = 200000 + 1
    for i in range(n):

        if current_min < p[i]:
            continue 

        current_min = min([current_min, p[i]])

        done = False
        for j in range(i+1):
            if p[i] <= p[j]:
                if j == i:
                    done = True
            else:
                break
        if done:
            result.append(i)


    return len(result)


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        print("%d %d" % (result[0], result[1]))
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Time Limit Exceeded

Solution code:
import copy
N = int(input())
P = list(map(int, input().split()))
result = copy.copy(P)
for i in range(N):
    l = P[:i]
    for p in l:
        s = P[i]
        if p < s:
            result.remove(s)
            break
print(len(result))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = N
for a in P:
    for b in P[:P.index(a)+1]:
        if a > b:
            cnt -=1
            break
print(cnt)

Submission status: Time Limit Exceeded

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

res = 0
a = []
for i in p:
    a.append(i)
    if i == min(a):
        res += 1

print(res)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
data = list(map(int, input().split()))
ans=1
if N==1:
    ans=1
elif N>1:
    for i in range(1,N):
        count=0
        for k in range(0,i+1):
            if data[i]<=data[i-k]:
                count+=1
                if count==i+1:
                    ans+=1
                    #print("I=",i)
                    break
            elif data[i]>data[i-k]:
                break


print(ans)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    P = list(map(int,input().split()))
    a = 0
    for i in range(N):
        hantei = 0
        for j in range(i):
            if P[i] > P[j]:
                hantei = 1
                break
        if hantei == 0:
            a += 1
    print(a)
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def search(ind):
    for i in range(ind):
        if p_ls[i] < p_ls[ind]:
            return 0
    return 1

n = int(input())
p_ls = list(map(int, input().split()))
sub_cnt = 0
one = p_ls.index(1)+1
for i in range(one):
    sub_cnt += search(i)
print(sub_cnt)

Submission status: Time Limit Exceeded

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

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

print(ok_count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = n
for i in range(n):
    if not all(p[i]<=p[j] 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())) 
res = len(p)
for i in range(len(p)):
    if i == 0:
        continue
    else:
        for j in range(i):
            if p[i] >= p[j]:
               res -= 1
               break
print(res)

Submission status: Time Limit Exceeded

Solution code:
s=input().split()
n=int(s[0])
s=input().split()
lis=[]
out=0
for i in range(n):
    lis.append(int(s[i]))
    if min(lis)>=int(s[i]):
        out+=1
print(out)

Submission status: Time Limit Exceeded

Solution code:
def function(p, i):
  a = p[i]
  amin = min(p[:i+1])
  if amin == a:
    return 1
  else:
    return 0

n = int(input())
p = list(map(lambda x: int(x), input().split()))
sums = sum([function(p,i) for i in range(n)])
print(sums)

Submission status: Time Limit Exceeded

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


counter = 0

for i in range(len(plist)):
    islow = True
    for j in range(plist.index(plist[i])):        
        if plist[i] <= plist[j]:
            pass
        else:
            islow = False
            break
    if islow:
        counter += 1

print(counter)

Submission status: Time Limit Exceeded

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

ans_list = []
for i in range(N):
  ANS = []
  for j in range(i+1):
    if P[i] <= P[j]:
      ANS.append(j)
    else:
      break
  if i+1 == len(ANS):
    ans_list.append(i)
print(len(ans_list))

Submission status: Time Limit Exceeded

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

count = 1
for i in range(1, len(p_list)):
  if len(p_list) >= 0 :
    if min(p_list[:i+1]) == p_list[i] :
      count += 1
      
print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

ans = 0
for i in range(n):
    flag = True

    if i > 0:

        if min(p[:i+1]) != p[i]:
            flag = False

    if flag:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
S=input().split()
NS = [int(i) for i in S]
def exist():
    s=0
    for i in range(N):
      cond=True
      for j in range(0,i):
         if NS[i]>NS[j]:
            cond=False
      if cond:
        s+=1   
    return s
if __name__=='__main__':
   print(exist())

Submission status: Time Limit Exceeded

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


def solve(N: int, P: "List[int]"):

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

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, P)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Ps = list(map(int, input().split()))
count = 0
low = -1

for i in range(N):
    low = Ps[i]

    if ( sum(x < low for x in Ps[:i]) == 0):
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

index = [i for i in range(N)]

dict_value = {key: val for key, val in zip(index, P)}
ac = [dict_value[i] for i in range(N) if dict_value[i] <= min([v for k, v in dict_value.items() if k <= i])]

print(len(ac))

Submission status: Time Limit Exceeded

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

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

cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

num = 1

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

print(num)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

j = 0

for i in range(1,n+1):
  lii = sorted(li[0:i])
  if lii[0] == li[i-1]:
    j = j + 1

print(j)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
miss = 0
for i in range(n):
    s = p[0:i]
    s = sorted(s,reverse=True)
    #print(s)
    for j in range(i):
        if p[i] > s[j]:
            miss += 1
            break

print(n-miss)

Submission status: Time Limit Exceeded

Solution code:
#https://atcoder.jp/contests/abc152/tasks/abc152_c
# -*- coding: utf-8 -*-
N = int(input())
P = input().split()
T = [1]*N
for i in range(len(P)):
  P[i] = int(P[i])
for i in  range(1,len(P)):
  for k in range(0,i):
    if P[i]>P[k]:
      T[i] = 0
print(T.count(1))

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''
# import numpy as np


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

    count = 0
    for i in range(N):
        Q = sorted(P[:i+1], reverse=True)
        # print(i+1, Q)
        if Q[-1] == P[i]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

c = [0] * n

for i in range(n):
    for j in range(i):
        if p[i] > p[j]:
            c[i] = 1
            break

print(c.count(0))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
P=list(map(int,input().split()))
count=1
for i in range(1,n):
    for j in range(i):
        if P[j]<P[i]:
            break
        if j==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):
    flg = True
    for j in range(i):
        if p[i] > p[j]:
            flg = False
    if flg:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
P = np.array(input().split(' '), dtype = int)

counta = 0
for i in range(N):
    counta += np.all((P >= P[i])[:i+1])
print(counta)

Submission status: Time Limit Exceeded

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

#print(N)
#print(List[0])
i_ok_count=0
break_flag=0
for i in range(len(List)):
  #print(i+1)#i
  for j in range(i):
    if List[i]>List[j]:
      break_flag=1
      break
  if break_flag!=1:
    i_ok_count+=1
  break_flag=0

print(i_ok_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):
    flag = True
    for j in range(i):
        if P[j] < P[i]:
            flag = False
            break
    if flag:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

print(answer)

Submission status: Time Limit Exceeded

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

ans=0

for i in range(N):
    x = sorted(P[0:i+1])
    if x.index(P[i]) == 0:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


counter = 0

for i in range(len(plist)):
    islow = True
    for j in range(plist.index(plist[i])):        
        if plist[i] <= plist[j]:
            continue
        else:
            islow = False
            break
    if islow:
        counter += 1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
input_list=[input() for i in range(2)]
N = int(input_list[0])
P_s = list(map(int,input_list[1].split()))	
output_s = 0
for i in range(N):
    output_num = 0
    for j in range(i+1):
        if P_s[i] > P_s[j]:
            output_num += 1
    if output_num <= 0:
        output_s += 1

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

print(counter)

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())
per = np.array([0] + [int(i) for i in input().split()])
res = 0
for i in range(1, N+1):
  flag = True
  
  if per[i] > min(per[1:i+1]): 
    pass
  else: 
    res += 1
print(res)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

ans = 0

for i in range(0, len(P)-1):
    if (P[1] <= P[0]):
        ans += 1
        del(P[0])
    else:
        del(P[1])

print(ans+1)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

cnt = 1
if len(p) >= 2 and p[0] >= p[1]:
  cnt += 1

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

print(cnt)

Submission status: Time Limit Exceeded

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

m = 0

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

print(m)

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 = 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):
    c = 1
    for j in range(i+1):
        if P[i] <= P[j]:
            c *= 1
        else:
            c *= 0
    cnt += c
print(cnt)