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

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
p=[int(x) for x in input().split()]
a=1
for i in range(1,n):
  if p[i]<=min(p[:i]):
    a+=1
print(a)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    if l[i] <= min(l[: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,p in enumerate(P) :
    pj_min = min(P[:i+1])
    if p <= pj_min :
        count += 1
    
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
'''
Created on 2020/08/17

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N=int(pin())
  P=list(map(int,pin().split()))
  ans=0
  for i in range(N):
    if min(P[:i+1])==P[i]:
      ans+=1
  print(ans)
  return 

main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    P = LI()
    ans = 0
    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 bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    N = I()
    P = LI()
    bar_ans = 0
    for i in range(N):
        for j in range(0,i+1):
            if P[j]<P[i]:
                bar_ans += 1
                break
            else:
                pass
    print(N - bar_ans)

main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

bits = 0

result = 0
for x in p:
  if x == 1:
    bits |= 1 << x - 1
    result += 1
    continue
  
  lower_bits = '1' * (x - 1)
  
  if (bits & int(lower_bits, 2)) > 0:
    bits |= 1 << x - 1
    continue
    
  result += 1
  bits |= 1 << x - 1

print(result)

Submission status: Time Limit Exceeded

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

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

print(cnt)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    s = p[:i+1]
#sの最小値とsの末尾が一致するかどうか
    if s[-1] == min(s):
        c += 1
        
print(c)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(N):
    P_min.append(min(P[0:i+1]))

for i in range(N):
    if P_min[i] >= 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):
    for j in range(i+1):
        if P[i] > P[j]:
            break
        else:
            if j == i:
                ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

for i in range(N):
    A.append(P[i])
    if min(A) == P[i]:
        ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(n):
  list.append(p[i])
  if min(list)==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):
  if min([p[t] for t in range(i+1)])==p[i]:
    cnt+=1
    
print(cnt)

Submission status: Time Limit Exceeded

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

for i in range(n):
    s = p[:i+1]
#sの最小値とsの末尾が一致するかどうか
    if s[-1] == min(s):
        c += 1
        
print(c)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

print(sum(list(filter(lambda x: x<P[i], set(P[:i+1])))==[] for i in range(N)))

Submission status: Time Limit Exceeded

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

print(sum(list(filter(lambda x: x<P[i], P[:i+1]))==[] for i in range(N)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

list=[]
b=0
for i in a:
	list.append(i)

	if list[-1]<=min(list):
		b+=1
print(b)

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

Submission status: Time Limit Exceeded

Solution code:
def low_elements():
    # 入力
    N = int(input())
    P = list(map(int, input().split()))
    # 初期処理
    count = 0
    # joken_list = [True] * N
    # 処理
    # for i in range(N):
    #     for j in range(0, i):
    #         if not(P[i] <= P[j]):
    #             joken_list[i] = False
    #             break
    # P[0]~P[j] の最小値がP[i]より大きければいい
    for i in range(N):
        min_num = min(P[0:i+1])
        if P[i] <= min_num:
            count += 1
            # joken_list[i] = False
    # # 条件を満たすiの個数
    # count = 0
    # for joken in joken_list:
    #     if joken:
    #         count += 1
    return count

result = low_elements()
print(result)

Submission status: Time Limit Exceeded

Solution code:
def low_elements():
    # 入力
    N = int(input())
    P = list(map(int, input().split()))
    # 初期処理
    joken_list = [True] * N
    # 処理
    # for i in range(N):
    #     for j in range(0, i):
    #         if not(P[i] <= P[j]):
    #             joken_list[i] = False
    #             break
    # P[0]~P[j] の最小値がP[i]より大きければいい
    for i in range(N):
        min_num = min(P[0:i+1])
        if not(P[i] <= min_num):
            joken_list[i] = False
    # 条件を満たすiの個数
    count = 0
    for joken in joken_list:
        if joken:
            count += 1
    return count

result = low_elements()
print(result)

Submission status: Time Limit Exceeded

Solution code:
def low_elements():
    # 入力
    N = int(input())
    P = list(map(int, input().split()))
    # 初期処理
    joken_list = [True] * N
    # 処理
    for i in range(N):
        for j in range(0, i):
            if not(P[i] <= P[j]):
                joken_list[i] = False
                break
    # 条件を満たすiの個数
    count = 0
    for joken in joken_list:
        if joken:
            count += 1
    return count

result = low_elements()
print(result)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# abc152_c.py
# https://atcoder.jp/contests/abc152/tasks/abc152_c

# C - Low Elements /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 300点

# 問題文
# 1,…,Nの順列 P1,…,PN が与えられます。
# 次の条件を満たす整数 i(1≤i≤N)の個数を数えてください。
#     任意の整数 j(1≤j≤i)に対して、 Pi≤Pj

# 制約
#     1≤N≤2×105
#     P1,…,PN
#     は 1,…,Nの順列である。
#     入力はすべて整数である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# P1 ... PN

# 出力
# 条件を満たす整数 iの個数を出力せよ。

# 入力例 1
# 5
# 4 2 5 1 3

# 出力例 1
# 3

# i=1,2,4が条件を満たします。
# i=3 は条件を満たしません。
# 例えば、 j=1 とすると、 Pi>Pj となります。
# 同様に、 i=5 も条件を満たしません。
# したがって、条件を満たす整数 i の個数は 3となります。

# 入力例 2
# 4
# 4 3 2 1

# 出力例 2
# 4

# すべての整数 i(1≤i≤N)が条件を満たします。

# 入力例 3
# 6
# 1 2 3 4 5 6

# 出力例 3
# 1

# i=1のみが条件を満たします。

# 入力例 4
# 8
# 5 7 4 2 6 8 1 3

# 出力例 4
# 4

# 入力例 5
# 1
# 1

# 出力例 5
# 1


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    result = 0
    for n in range(N):
        tmp = values[:n+1]
        last_item = values[n]
        if min(tmp) == last_item:
            result += 1

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5', '4 2 5 1 3']
        lines_export = [3]
    if pattern == 2:
        lines_input = ['4', '4 3 2 1']
        lines_export = [4]
    if pattern == 3:
        lines_input = ['6', '1 2 3 4 5 6']
        lines_export = [1]
    if pattern == 4:
        lines_input = ['8', '5 7 4 2 6 8 1 3']
        lines_export = [4]
    if pattern == 5:
        lines_input = ['1 1']
        lines_export = [1]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

cnt = 1
if n==1:
    print(cnt)
else:
    for i in range(1,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, p in enumerate(P):
    if p == min(P[:i + 1]):
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=1
X=[]
for i in range(N-1):
  X.append(A[i])
  if min(X)>A[i+1]:
    count+=1
print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = input()
P = list(map(int, input().split()))
count = 0
for i in range(int(N)):
    temp = 0
    for j in range(i+1):

        if P[i] <= P[j]:
            temp = temp + 1
        else:
            temp =0
    if temp == j+1:
        count = count + 1
print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 1
min_num = P[0]
for num in range(len(P)):
  tmp = min(P[:num+1])
  if min_num > tmp:
    min_num = tmp
    ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 0
for index,p in enumerate(P):
  if all(p <= pp for pp in P[:index]):
    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())
P = list(map(int,input().split()))
P_past = []
cnt = 0
for i in range(N+1):
    P_past.append(0) 
for i in range(N):
    if sum(P_past[0:P[i]+1])!=0:
        cnt +=1
    P_past[P[i]]=P[i]
cnt = len(P)-cnt
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):
    tmp = p[:i+1]
    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()))
cnt = 0
for i in range(N):
    Pi = P[i]
    for j in range(i):
        Pj = P[j]
        #print(Pj)
        if Pi > Pj:
            cnt +=1
            break
cnt = len(P)-cnt
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):
    Pi = P[i]
    for j in range(i+1):
        Pj = P[j]
        if Pi > Pj:
            cnt +=1
            break
cnt = len(P)-cnt
print(cnt)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n,*p=map(int,open(0).read().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(n):
    li = p[:i+1]
    if min(li) == p[i]:
        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):
    li = p[:i+1]
    li.sort()
    if li[0] == p[i]:
        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):
    li = p[:i+1]
    li.sort()
    m.append(li[0])
    if m[i] == p[i]:
        count += 1
        
print(count)

Submission status: Time Limit Exceeded

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

ans = 0

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

Submission status: Time Limit Exceeded

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

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

print(sum(ans))

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
n = int(input())
P = list(map(int, input().split()))[::-1]
p = Counter(P)

cnt = 0
for i in range(n):
    flag = True
    p[P[i]] -= 1
    if p[P[i]] == 0: p.pop(P[i])
    for x,y in p.items():
        if x < P[i]:
            flag = False
            break
    if flag: cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    q.append(p[i])
    if not p[i] <= min(q):
        m -= 1

print(m)

Submission status: Time Limit Exceeded

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

for i in range(n):
    q = p[0:i+1]
    if not p[i] <= min(q):
        m -= 1

print(m)

Submission status: Time Limit Exceeded

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

for i in range(n):
    for j in range(i + 1):
        if not p[i] <= p[j]:
            m -= 1
            break

print(m)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
p = list(map(int,input().split()))
cou1 = 0
cou2 = 0
num1 = min(p)
num2 = p.count(num1) 


for i in range(N):
    num3 = min(p[0:i+1])
    if p[i] == num3:
        cou1 += 1
    if p[i] == num1:
        cou2 += 1
    if cou2 == num2:
        break
    
print(cou1)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(N):
    c = 0
    for j in range(i):
        if p[i] > p[j]:
            c+=1
            break
    if c == 0:
        cou += 1
    
print(cou)

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

Submission status: Time Limit Exceeded

Solution code:
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    P = LI()
    ans = 0

    for i in range(N):
        for j in range(0,i+1):
            if P[j]<P[i]:
                break
            elif j == i:
                ans += 1

    
    print(ans)

if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

last_ok_postion = 0 
last_ok_value = P[0]
count = 1

for i in range(1,N):
    if last_ok_value >= P[i]:
        m = min(P[last_ok_postion:i])
        if m >= P[i]:
            count += 1
print(count)

Submission status: Time Limit Exceeded

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

last_ok_postion = 0 
last_ok_value = P[0]
count = 1

for i in range(1,N):
    if last_ok_value >= P[i]:
        check = 0
        for j in range(last_ok_postion,i)[::-1]:
            if P[j] < P[i]:
                check = 1
                break
        if check == 0:
            count += 1
print(count)

Submission status: Time Limit Exceeded

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

for i, item in enumerate(p):
    if min(p[:i+1]) == item:
        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(len(p)):
    if min(p[:i+1]) == p[i]:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

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

ans = 0

for p,j in zip(P,range(len(P))):
    if len(P[:j]) == 0:
        ans += 1
    elif (min(P[:j]) >= p):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
A = np.array([int(x) for x in input().split()])
end_set = set()
count = 0

for a in A:
    if not end_set:
        count += 1
    elif a == min(min(end_set), a):
        count += 1
    end_set.add(a)

print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
A = np.array([int(x) for x in input().split()])

count = 0

for index, a in enumerate(A):
    if np.all(A[:index+1] >= a):
        count += 1

print(count)

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    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)
resolve()

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n):
  if p[i] == min(p[:i+1]):
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    partP = P[:i+1]
    flag = True 
    partP = sorted(partP)[::-1]
    for p in partP:
        if P[i] <= p:
            continue
        else:
            flag = False
            break
    if flag:
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    partP = P[:i+1]
    cnt = 1
    partP.sort()
    for p in partP:
        if cnt == 0:
            break
        elif P[i] <= p:
            continue
        else:
            cnt *= 0
    if cnt == 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):
    partP = P[:i+1]
    cnt = 1
    for p in partP:
        if cnt == 0:
            break
        elif P[i] <= p:
            continue
        else:
            cnt *= 0
    if cnt == 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):
    partP = P[:i+1]
    cnt = 0
    for p in partP:
        if P[i] <= p:
            cnt += 1
        else:
            continue
    if cnt == len(partP):
        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):
    temp = p[:i]
    if min(temp) >= p[i]:
        count += 1

print(count)