Problem:


Score : 300 points

Problem Statement

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

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

Constraints

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

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

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
P_1 ... P_N

Output

Print the number of integers i that satisfy the condition.

Sample Input 1

5
4 2 5 1 3

Sample Output 1

3

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

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

Sample Input 2

4
4 3 2 1

Sample Output 2

4

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

Sample Input 3

6
1 2 3 4 5 6

Sample Output 3

1

Only i=1 satisfies the condition.

Sample Input 4

8
5 7 4 2 6 8 1 3

Sample Output 4

4

Sample Input 5

1
1

Sample Output 5

1



Sample input:
5
4 2 5 1 3


Sample output:
3

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p_list = map(int, input().split())
left_list = []
res = 0
for i in p_list:
  if i == 1:
    res += 1
  else:
    filter_left = list(filter(lambda x: i > x, left_list))
    if len(filter_left) == 0:
      res += 1
  left_list.append(i)
print(res)

Submission status: Time Limit Exceeded

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

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break
    if i < P.index(P[i]-1):
      i = P.index(P[i]-1)
      i -= 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):
    P_j = P[:i]
    if P_j == []:
        ans += 1
    elif min(P_j) >= P[i]:
        ans += 1
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):
    for p in range(i):
        if P[p] < P[i]:
            break
    else:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int, input().split()))
tmpIndex = li.index(1)
count = 1

for i in range(2, n+1):
    if li.index(i) < tmpIndex:
        count += 1
        tmpIndex = li.index(i)
    else:
        pass

print(count)

Submission status: Time Limit Exceeded

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

print(n-miss)

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

ans = 0
for i in range(0, 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()))

cnt = 1
s=0

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

print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0

for j in range(N):
    #print("j="+str(j))
    for k in range(j+1):
        #print("k="+str(k))
        if(list[k] < list[j]):
            break

        if(k == j):
            count += 1
            break


print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

cnt = 0

for i in range(n):
    if min(pp[:i + 1]) >= pp[i]:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

cnt = 0
for i in range(len(p)):
    p_where = np.where(p > p[i], 1, 0)
    total = sum(p_where[0:i])
    
    if (total == i):
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

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

for i in range(n):
  kkk = ( 1<<(a[i]-1) ) -1
  if bit&kkk == 0:
    ans += 1
  bit += 2**(a[i]-1)
  
    
  
print(ans)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(0, N):
    flag = 0
    for j in range(0, i):
        if array[i] > array[j]:
            flag = 1
            break
    if not flag == 1:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    ans = 0
    P = [int(_) for _ in input().split()]
    for i in range(N):
        if min(P[:i+1]) == P[i]:
            ans += 1
    print(ans)
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)
n=0
m=1

for i in range(N):
    for j in range(i):
        if p[i]<=p[j]:
            n+=1
        if n==i:
            m+=1
    n=0
print(m)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
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
    if islow:
        counter += 1

print(counter)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    p = list(map(int, input().split()))
    count = 0
    for i in range(n):
        min_i = min(p[:i+1])
        if p[i] == min_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()))

ret = 0
for i in range(n):
    f = True
    for j in range(i):
        f = f and (p[i] <= p[j])
    if f:
        ret +=1

print(ret)

Submission status: Time Limit Exceeded

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

num =0
for i in range(N):
  if ll[:i+1].min() == ll[i]:
    num+=1
print(num)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
l = [2*10**5]
cnt=0

for i in range(n):
  for j in range(i):
    l.append(p[j])
  m = min(l)
  if m>= p[i]:
    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 N == 1:
    count = 1
    break
  dame = False
  for j in range(i):
    if P[i] > P[j]:
      dame = True
      break
  if not dame:
    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(0, i+1):
        if P[i] > P[j]:
            break
    else:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

ret = 0
p = np.array(p)
for i in range(len(p)):
    if (p[:i] > p[i]).all():
        ret +=1
print(ret)

Submission status: Time Limit Exceeded

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

A = 0

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

Submission status: Time Limit Exceeded

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

ans=1
for i in range(1,n):
    s2=s[:i+1]
    #print(max(s2))

    if s[i]<=min(s2):
        ans+=1
    
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# ABC 152 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
snm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
p=nl()
s=[]
ans=0
for i in range(n):
    if i==0:
        ans+=1
        s.append(p[i])
        continue
    if p[i]<=min(s):
        ans+=1
    s.append(p[i])
print(ans)

Submission status: Time Limit Exceeded

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

for i in range(N):
    flag=0
    
    for j in range(i):
        if mylist[i]>mylist[j]:
            #一つでも条件満たさないjがあればflagを-1にする
            flag=-1
    
    if flag==0:
        #flagが0であれば、そのiに対して答えを+1する
        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):
  if min(P[:i+1]) == P[i]:
    Ans += 1
print(Ans)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

    ans = 0
    min = N+1

    while len(P) != 0:
        p = P.pop(0)
        if min > p:
            min = p
            ans+=1


    print(ans)

    return 0

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
# ABC 152 C

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

res = 0

for i in range(N):
    if P[i] <= min(P[:i+1]):
        res += 1
    else:
        continue

print(res)

Submission status: Time Limit Exceeded

Solution code:
dummy = list(map(int, input().split(" ")))
N = dummy[0]

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

out = 0
for a in range(N):
    flag = 1
    for b in range(a + 1):
        #print(P[a], P[b])
        if(P[a] > P[b]):
            flag = 0
            break
    if(flag == 1):
        out += 1

#print(P)
print(out)

Submission status: Time Limit Exceeded

Solution code:
import sys

n = int(input())
plist=[int(_) for _ in input().split()]

if n == 1:
  print("1")
  sys.exit()

result = 1
for i in range(1,len(plist)):
  if plist[i] <= min(plist[0:i]):
    result += 1

print(result)

Submission status: Time Limit Exceeded

Solution code:
#①自分より左側に自分より小さい数字がいてはいけない。

N = int(input())
P = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
count=0#①を満たさない個数をカウント

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

print(len(P)-count)#①を満たす個数を算出

Submission status: Time Limit Exceeded

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

ans_r=0
for p in range(0, N):
  for q in range(0, p):
    if (P[p] > P[q]):
      ans_r += 1
      break
print (N-ans_r)

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 = list(map(int,input().split()))
c = 0
for i in range(1,N+1):
    P_ = P[:i]
    pi = P[i-1]
    if min(P_) >= pi:
        c += 1
    # print(P_,pi)
print(c)

Submission status: Time Limit Exceeded

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

for i in range(N):
  l = np.array([P[i]] * N)
  tmp = list(P - l)[0:i+1]
  if min(tmp) >= 0:
    ans += 1

print(ans)

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):
    if np.sum((P >= P[i])[:i+1]) == i + 1:
        counta += 1
print(counta)

Submission status: Time Limit Exceeded

Solution code:
hoge = [input() for i in range(2)]
tmp = hoge[1].split()
num = int(hoge[0])

tmp = list(map(int,tmp))

flag = 1
count = 0

for i in range(num):
    for j in range(i):
        if tmp[i] > tmp[j]:
            flag = 0
    if flag == 1:
        count += 1
    flag = 1

print(count)

Submission status: Time Limit Exceeded

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

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

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

print(ans)

Submission status: Time Limit Exceeded

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

count = 0

for j in range(N):
    #print("j="+str(j))
    for k in range(j+1):
        #print("k="+str(k))
        if (list[k] >= list[j]):
            #print("k > j")
            if(k == j):
                count += 1
                break

            continue
        elif(list[k] < list[j]):
            break

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(result_list.count(0))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(map(int,input().split()))
pc = p.copy()
 
a = 0
for i in range(n):
  pi = p.index(i+1)
  pci = pc.index(i+1)
  if pi == pci:
    a += 1
  pc.pop(pci)
  if pi == 0:
    break
print(a)

Submission status: Time Limit Exceeded

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

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]

    for j in range(i):
        if (low > Ps[j]):
            break
        if (j == i-1):
            count += 1

print(count+1)

Submission status: Time Limit Exceeded

Solution code:
import bisect

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

    ans = 0
    min = N+1

    while len(P) != 0:
        p = P.pop(0)
        if min > p:
            min = p
            ans+=1


    print(ans)

    return 0

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

times = 0
min_num = N+1
for i in range(len(P)):
  safe = True
  if min_num < int(P[i]):
    continue
  min_num = int(P[i])
  for j in range(i+1):
    if not int(P[i]) <= int(P[j]):
      safe = False
  if safe:
    times += 1
print(times)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

ret = 0
for i in range(len(p)):
    if (np.array(p[:i]) > p[i]).all():
        ret +=1
print(ret)

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
from sys import stdin


def main():
    # コンソール入力を受け取る
    N = int(stdin.readline().rstrip())
    P = stdin.readline().rstrip().split()
    P = [int(i) for i in P]

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


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n =int(input()) 
t = [int(i) for i in input().split()]
s=n
for i in range(2,n+1):
    for j in range(1,i):
        if t.index(j)<t.index(i):
            break
    else:
        continue
    s-=1
    #print(i,j)
print(s)

Submission status: Time Limit Exceeded

Solution code:

import numpy as np

N = int(input())
P = input().split()
P = np.array([int(p) for p in P])

ans = N
for i, p in enumerate(P):
  ans -= int(((P[:i+1]<p).sum()>0))
print(ans)

Submission status: Time Limit Exceeded

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

cnt = 0

for i in range(n):
    for p in pp[:i + 1]:
        if pp[i] > p:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#①自分より左側に自分より小さい数字がいてはいけない。

N = int(input())
P = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
count=0#①を満たさない個数をカウント

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

print(len(P)-count)#①を満たす個数を算出

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):
        for p in range(i):
            if P[p] < P[i]:
                break
        else:
            count += 1
    print(count)
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

print(n-ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list1=list(map(int,input().split()))
list2=[i for i in list1 if i<=list1[0]]
ln=[list1[0]]
for i in list2:
    if min(ln)>=i:
        ln.append(i)
print(len(ln)-1)

Submission status: Time Limit Exceeded

Solution code:
import copy
n = int(input())
num = list(map(int,input().split()))

end = n
i = 0
while i < end-1:
    for j in range(end-1, i, -1):
        if num[j] > num [i]:
            num.pop(j)
    end = len(num)
    i += 1
    
print(end)

Submission status: Time Limit Exceeded

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



mini=1
count=1
index_min=P.index(mini)
while P[0]>mini:
  P=P[:index_min]
  mini=min(P)
  index_min=P.index(mini)
  count+=1
"""
count=1
for i in range(1,N):
  if min(P[:i+1])==P[i]:
    count+=1
"""
print(count)

Submission status: Time Limit Exceeded

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

num =0
for i in range(N):
  l2 = ll[:i+1]
  if sorted(l2)[0] == ll[i]:
    num += 1
print(num)

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

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_lis = list(map(int,input().split()))
 
count = 0
for i in range(N):
  for j in range(i):
    if P_lis[i] >= P_lis[j]:
      count += 1
      break
print(N - count)

Submission status: Time Limit Exceeded

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

ans = 1
for i in range(len(box)):
  if i == 0: continue
  tibi = min(box[:i])
  if box[i] <= tibi:
    ans += 1
    
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

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

a = 0
c = 0
for i in range(l):
    for j in range(i+1):
        if order[j] >= order[i]:
            c = c + 1
        if c - 1  == i:
            a = a + 1
        if j  == i:
            c  = 0
print(a)

Submission status: Time Limit Exceeded

Solution code:
import sys


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


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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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)

Submission status: Time Limit Exceeded

Solution code:
# ABC 152 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
snm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
p=nl()
ans=0
for i in range(n):
    if i==0:
        ans+=1
        continue
    if p[i]<=min(p[:i]):
        ans+=1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
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:
        #print(i)
        count += 1            

print(count)

Submission status: Time Limit Exceeded

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

sum = 0
for i in range(N):
  condition_met = True
  for j in range(i):
    if not P[i] <= P[j]:
      condition_met = False
      
  if condition_met:
    sum += 1

print(sum)

Submission status: Time Limit Exceeded

Solution code:
#C
import numpy as np

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

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N=int(input())

P=np.array(input().split(" "),dtype=np.int32)

count=0
flag=True
for i in range(N):
    for j in range(i+1):
        if(P[i]<=P[j]):
            pass
        else:
            flag=False
    if(flag):
        count+=1
    flag=True
    

print(count)

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)
  if i+1 == len(ANS):
    ans_list.append(i)
print(len(ans_list))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = [int(x) for x in input().split()]
count = 0
check = 0
for i in range(N):
    check = 0
    for j in range(i):
        if P[i] > P[j]:
            check = 1
            break
    if check == 0:
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

i_count = 1
for i in range(1, N):
  if (P[:i] < P[i]).any() == False:
    i_count +=1
  
print(i_count)

Submission status: Time Limit Exceeded

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


for i in range(N):
    an=0
    for j in range(0, i):
        if P[j]>=P[i]:
            an+=1
        else:
            an+=0
    if an==i:
        ans+=1
    else:
        ans+=0
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# AtCoder Beginner Contest 152: C (2020/01/19)
N = int(input())
P = [0 for i in range(N)]
l = input().split()
for i in range(N):
    P[i] = int(l[i])
cnt = 0
for i in range(N):
    flag = True
    for j in range(i+1):
        if P[j] < P[i]:
            flag = False
            break
    if flag == True:
        cnt = cnt + 1
print(cnt)

Submission status: Time Limit Exceeded

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


c = 1
for i in range(1, n ):

    if p[i] <= min(p[0:i ]) :
        c = c + 1
print(c)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    ng=True
    for j in range(i+1):
        if p[j] < p[i]:
            ng=False
            break
    if ng:
        count+=1
        continue

print (count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

    n = 0
    x = 10 ** 20
    for i in range(N):
      if x < P[i]:
        continue
      else:
        x = P[i]
        for j in range(i):
            if P[i] > P[j]:
                break
        else:
            n += 1
    print(n)

resolve()

Submission status: Time Limit Exceeded

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

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break


print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
list1=list(map(int,input().split()))
list2=[i for i in list1 if i<=list1[0]]
ln=[list1[0]]
for i in list1:
    if min(ln)>=i:
        ln.append(i)
print(len(ln)-1)

Submission status: Time Limit Exceeded

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

ans = 1
for i in range(2, N+1):
  if min(P[:i-1]) < P[i-1]:
    pass
  else:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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