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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
p = 0
minnum = 200001
counter = 0

for i in range(N):
  p = int(input())
  if p < minnum:
    counter += 1
    minnum = p

print(counter)

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

ans = 1
for i in range(1,N):
  pi = p[i]
  pm = min(P[:i])
  if pi <= pm:
    ans +=1

print(ans)

Submission status: Runtime Error

Solution code:
max = 0
cnt = 0
N = int(input())
for _ in range(N):
	p = int(input())
	if max < p:
		max = p
		cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
max = 0
cnt = 0
N = int(input())
for _ in range(N):
	p = int(input())
	if max < p
		max = p
		cnt += 1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = input().split()
n = int(x[0])
m = x[1:len(x)]
k = 0
for i in range(0,n):
    a = int(m[i])
    for j in range(0,i):
        if int(m[i]) > int(m[j]):
            a = int(m[j])
    if a == int(m[i]):
        k += 1
print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int,input().split()))
min_num = MAX(l) +1
ans = 0
for i in l:
  if min_num >= i:
    min_num = i
    ans += 1
print(ans)

Submission status: Runtime Error

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

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

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

print(ans)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
  
  int n;
  cin >> n;
  
  vector<int> lists(n);
  for(int i=0; i<n;i++){
    cin >> lists.at(i);
  }
  
  int ans = 1;
  int std = lists.at(0);
  
  for(int i=1;i<n;i++){
    if(lists.at(i) < std){
      ans += 1;
      std = lists.at(i);
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Submission status: Runtime Error

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

for i in range(N):
  M=min(M,a[i])
  if a[i]<=M:
    c=c+1	

print(c)

Submission status: Runtime Error

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

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

print(count1)

Submission status: Runtime Error

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

ret = 0
currmin = P[0]
for i in range(N):
    if P[i] <= currmin:
        currmin = P[i]
        ret += 1

print(ret)

Submission status: Runtime Error

Solution code:
import numpy as np

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

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

Submission status: Runtime Error

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


def main():
    N = int(input())
    P = list(map(int, input().split()))
    cnt = 0
    pmax = P[0]
    for i in P:
        if P[i] <= pmax:
            pmax = P[i]
            cnt += 1
        print(cnt)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

a=1
for i in range(1,N):
    if np.min(n[:i]) < n[i] : continue
    else: a+=1   
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

j = p[0]
count = 1
for i in range(n):
  '''
    if j == 1:
        break
        '''
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
import math

v_min = math.inf

def solve(arr):
  global v_min
  count = 0
  for v in arr:
    if v <= v_min:
      count += 1
      v_min = v
  return count

if __name__ == "__main__":
  _n = int(input())
  arr = [int(i) for i in input().split()]
  ans = solve(arr)
  print(int(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
line = list(map(int,input().split()))
a = 0
p = []
for i in N:
    p.append(N)
    if  min(p) >= N:
       a += 1

print(a)

Submission status: Runtime Error

Solution code:
import numpy as np

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

history = []
count = 0

for i in range(0,num[0]):
    history.append(num[i+1])
    num_min = np.min(history)
    if(num[i+1] <= num_min):
        count = count + 1

print(count)

Submission status: Runtime Error

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

history = []
count = 0

for i in range(0,num[0]):
    history.append(num[i+1])
    num_min = np.min(history)
    if(num[i+1] <= num_min):
        count = count + 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import gcd
M = 10**9+7


def lcm(a, b): return (a//gcd(a, b))*b


totalLCM = 1

n = int(input())
a = [int(x) for x in input().split()]
for i in a:
    totalLCM = lcm(totalLCM, i)

ans = 0
for i in a:
    ans += (totalLCM//i)
    ans %= M

print(ans % M)

Submission status: Runtime Error

Solution code:
n = int(input())
l = [ int(input()) for i in range(n) ]
count = 0
for i in range(n):
    if l[i] < min(l[:i]):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
import numpy as np

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

history = []
count = 0

for i in range(0,num[0]):
    history.append(num[i+1])
    num_min = np.min(history)
    if(num[i+1] <= num_min):
        count = count + 1

print(count)

Submission status: Runtime Error

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

counter = 0
for i in range(len(N_list)):
    if N_list[i] == min(N_list[:i+1]):
        couter += 1
print(counter)

Submission status: Runtime Error

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

counter = 0
for i in range(len(N_list)):
    if N_list[i] == min(N_list[:i+1]):
        couter += 1
print(counter)
print()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from typing import List


class Solution:
    def solve(self, N: int, P: List[int]) -> int:

        max_p = N
        answer = 0

        for pn in P:
            if pn <= max_p:
                answer += 1
                max_p = pn

        return answer


if __name__ == '__main__':

    # standard input
    N = int(input())

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

    # solve
    solution = Solution()
    print(solution.solve(N, P))

Submission status: Runtime Error

Solution code:

class Solution:
    def solve(self, N: int, P: List[int]) -> int:

        max_p = N
        answer = 0

        for pn in P:
            if pn <= max_p:
                answer += 1
                max_p = pn

        return answer


if __name__ == '__main__':

    # standard input
    N = int(input())

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

    # solve
    solution = Solution()
    print(solution.solve(N, P))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 1
for i in range(1, N):
  for j in range(i):
    if P[i] > P[j]:
      break
    elif P[i] <= p[j] and j == i:
      cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 1
for i in range(1, N):
  for j in range(i):
    if P[i] > P[j]:
      break
    elif P[i] <= p[j] and j == i:
      cnt += 1
pritn(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 0
for i in range(N):
  for j in range(i):
    if P[i] > P[j]:
      break
    elif P[i] <= p[j] and j == i-1:
      cnt += 1
pritn(cnt)

Submission status: Runtime Error

Solution code:
"""
can do it by subproblems. for a given i, the only information you need from the previous values
is the min value of previous values.
the first i=0 is guaranteed to satisfy the constraint. (counting from zero).
"""
import sys


def count_low_elements(N, P):
    count = 0
    min_so_far = sys.maxsize
    for val in P:
        if val <= min_so_far:
            count += 1
            min_so_far = val
    return count


if __name__ == "__main__":
    test1 = \
"""5
4 2 5 1 3"""
    test2 = \
"""4
4 3 2 1"""
    test3 = \
"""6
1 2 3 4 5 6"""
    test4 = \
"""8
5 7 4 2 6 8 1 3"""
    test5 = \
"""1
1"""
    test = test5
    # N, P_string = test.split("\n")
    # P = list(map(int, P_string.split()))
    N = int(input())
    P = list(map(int, input().split()))
    print(count_low_elements(N, P))
`

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
N = int(sys.stdin.readline())
nums = [int(x) for x in sys.stdin.readline().split]

ans = 0
_min = float('inf')
for num in nums:
  if _min >= num:
    ans += 1
  _min = min(_min, num)
print(ans)

Submission status: Runtime Error

Solution code:
import sys
from operator import itemgetter
import collections

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

def main():
    input = sys.stdin.readline
    n = int(input())
    p = map(int, input().split())
    print(r(n,p))

    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
l1=input().split()
l=[int(x)for x in l1]
ans=0
for i in range(n):
    list_now=l[0:i]
    num_now=l[i]
    list_now.sort()
    if num_now==list_now[0]:
        ans+=1
print(ans)

Submission status: Runtime Error

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

if n > 1:
    for i, pi in enumerate(p):
        if pi <= i:
            continue
        elif all([pj >= pi for pj in p[:i]]):
            m += 1
        else:
            continue

print(m)

Submission status: Runtime Error

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

if len(pi) > 1:
    for i, pi in enumerate(p):
        if pi <= i:
            continue
        elif all([pj >= pi for pj in p[:i]]):
            m += 1
        else:
            continue

print(m)

Submission status: Runtime Error

Solution code:
N = int(input())
p_list = str(input()).split()
for i in range(N):
    p_list[i] = int(p_list[i])
count = 0
for i in range(N):
    if p_list[i] = max(p_list[0:i+1]):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
'''C - Welcome to AtCoder
高橋君は AtCoder のコンテストに参加しています。

このコンテストでは、 N 問の問題が出題されます。
高橋君はコンテスト中に M回の提出を行いました。

i 回目の提出は pi番目の問題への提出であり、結果は Si (AC または WA) でした。
高橋君の正答数は、AC を 1回以上出した問題の数です。
高橋君のペナルティ数は、高橋君が AC を 1 回以上出した各問題において、初めて AC を出すまでに出した WA の数の総和です。
高橋君の正答数とペナルティ数を答えてください。

入力
入力は以下の形式で標準入力から与えられる。

N M
p1 S1
:
pM SM

2 5
1 WA
1 AC
2 WA
2 AC
2 WA
>
2 2

100000 3
7777 AC
7777 AC
7777 AC
>
1 0

6 0
>
0 0
'''
import numpy as np

N, M = map(int, input().split())

AC = np.array([0]*N) # 正解を入れる箱
WA = np.array([0]*N) # 不正解を入れる箱

for _ in range(M):
    p, S = input().split()
    
    if AC[int(p)-1] ==0 and S == "WA": # まだ「正解が出てない & 不正解」
        WA[int(p)-1] += 1              # なら不正解の箱に＋１
    else:
        AC[int(p)-1] = 1               # それ以外は正解の箱に１
    
print(sum(AC), sum(WA*AC)) # ただし不正解の箱は最後まで正解が出なかった問題はペナルティ無しにする必要があるので、正解の箱の中身と掛け合わせて消しておく。

Submission status: Runtime Error

Solution code:
'''
n = int(input())
seq = [int(e) for e in input().split(' ')]

count = 0
for i in seq:
  number_loop = len(seq[0:seq.index(i)+1])
  for idx, j in enumerate(seq[0:seq.index(i)+1]):
    if i > j:
      break
    if idx+1 == number_loop:
      count += 1
      
print(count)
'''

n = int(input())
seq = [int(e) for e in input().split(' ')]

count = 1

for idx, i in enumerate(seq[1:]):
  if i > seq[idx+2]:
   continue
  else:
    count += 1
print(count)

Submission status: Runtime Error

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

cnt = 0
for i in N:
  if all([A[v] >= A[i] for v in i]): 
    cnt = cnt +1

print(cnt)

Submission status: Runtime Error

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

pmin = p[0]
ans = 0
for i in range(n):
    if p[i] <= pmin:
        ans += 1
    pmin = min(pmin, p[i])

print(ans

Submission status: Runtime Error

Solution code:
def code(n,p):
    flg = 1

    for idx in range(1,n):
        if min(p[0:idx]) >= p[idx]:
            flg+=1
            print(p[idx])
    return flg

idx = code(n,p)
if idx == None:
    print(n)
else:
    print(idx)

Submission status: Runtime Error

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

def code(n,p)
  for idx, pp in enumerate(p):
    if pp>n:
      return idx

idx = code(n,p)
print(idx)

Submission status: Runtime Error

Solution code:
n=input()
p=input()
p=p.split()
q=[]
for i in range(int(n)):
    j=min(p[:i+1])
    if j==p[i]:
        q.append(p[i])
        print(q)
print(len(q))

Submission status: Runtime Error

Solution code:
n=input()
p=input()
p=p.split()
q=[p[0]]
for i in range(int(n)):
    j=max(p[:i+1])
    if j>p[i]:
        q.append(p[i])
        print(q)
if p[int(n)-1]!=min(p):
  if p[0]!=min(p):
     q.pop(-1)
    
print(len(q))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
M = 0
for P in map(int, input().split()):
    if P <= N:
        N = x
        M += 1
print(M)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = [(input()) for i in range(2)]
N = int(s[0])
t = s[1]
a = 1000000
b = 1
for i in range(N - 1):
    a = min(a,int(t[i]))
    k = i + 1
    c = int(t[k])
    if a >= c:
        b = b + 1
print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
s = [int(input()) for i in range(N)]
a = 10000000000
b = 1
for i in range(N - 1):
    a = min(a,s[i])
    if a >= s[i + 1]:
        b = b + 1
print(b)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
p=map(int,input().split())
for i in range(1,n):p[i]=min(p[i-1],p[i])
print(len(set(p)))

Submission status: Runtime Error

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

ans = 0
min = 0

for j in rainge(N):
    if (min  >= list[j]):
        abs += 1
        min = list[j]
    else:
        continue

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
lst = list(map(int, input().split()))
ans = [0]*n
ans[0] = lst[0]
for i in range(1, n):
  ans[i] = min(ans[i - 1], lst[i])
print(len(set(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
lst = map(int, input().split())
ans = [0]*n
ans[0] = lst[0]
for i in range(1, n):
  ans[i] = min(ans[i - 1], lst[i])
print(len(set(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[1]

for i in range(1,n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
m = [int(i) for i in input().split()]
mi = 2*10**5+1
h = 0
if n!=1:
  for i in range (n):
    if mi>m[i]:
      mi=m[i]
      h+=1
    g+=1
  print(h)
else:
  print(n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

list_parsed = []

count = 0
for elem in list_raw:
    if max(list_parsed) <= elem:
        count += 1

    list_parsed.append(elem)

print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
p = [int(x) for x in input.split()]
ans = 0
mn = n
for i in p:
  if mn > i:
    mn = i
  if mn >= i:
    ans += 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ntk = 0
l = []
for i in P:
	l.append(i)
	if i = min(l):
		cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
L = [_ for _ in map(int,input().split())]
res = 0
for x in L:
  if x <= N:
    res += 1
  	N = x #最小上書き。次にresが増えるのは後々の要素で最小より小さいのが出てきたとき。
print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
min_a=0
ans=0
for i,z in enumerate:
  if i==0:continue
  if min_a>=z:
    ans+=1
  min_a=min(min_a,z)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
min=0
ans=0
for i z in enumerate:
  if i==0:continue
  if min>=z:
    ans+=1
  min=min(min,z)
print(ans)

Submission status: Runtime Error

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

count = 1
min = p[0]


for i in p[1:]:
    if i < min_num:
        min_num = i
        count += 1
        

print(count)

Submission status: Runtime Error

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

count = 1
min = List[0]


for i in List[1:]:
    if i < min_num:
        min_num = i
        count += 1
        

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

minp = P[0]
ans = 0

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

print(ans)

Submission status: Runtime Error

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

for i in p:
    if i <= m:
        m = i
        cnt += 1


print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
    print(1)
    sys.exit()

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


myans = 0
mymin = 9999999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
    print(1)
    sys.exit()

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


myans = 0
mymin = 99999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
    print(1)
    sys.exit()

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


myans = 0
mymin = 9999999
for i in range(N):
    if mylist[i] < mymin:
        mymin = mylist[i]
        myans += 1
        
print(myans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
    print(1)
    sys.exit()

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


myans = 1
minn = mylist[0]
for i in range(N):
    if mylist[i] < minn:
        minn = mylist[i]
        myans += 1
    else:
        minn = mylist[i]
        
print(myans)

Submission status: Runtime Error

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: Runtime Error

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

for i in P:
	if m >= i:
    	ans += 1
   		m = i
print(ans)

Submission status: Runtime Error

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

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

print(counter)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input)
P = [int(x) for x in input().split()]
pmin = max(P)
cnt = 0
for p in P:
  if p <= pmin:
    cnt += 1
    pmin = p
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
%%time
N = int(input())
lis = list(map(int, input().split()))

counter = 0
for i in range(N):
    counter += int(lis[i] <= min(lis[:i+1]))
print(counter )

Submission status: Runtime Error

Solution code:
N = int(input())
P_lis = list(map(int,input().split()))
count = 0
min_P = P_lis[0]
for p in P_list:
  if p <= min_P:
    min_P = p
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    P_list = list(map(int,input().split()))
    i_num = 0
    min_P = P_list[0]
    for p in P_list:
        if p <= min_P:
            min_P = p
            i_num += 1
    print(i_num)

if __name__ == __main__:
    main()

Submission status: Runtime Error

Solution code:
import numpy as np

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

# print(N - sum([np.any(P[:i+1] < P[i]) for i in range(N)]))
ar_bool = (P >= P.reshape(-1,1))
counta = 0
for i in range(N):
    counta += np.all((ar_bool)[i][:i+1])
print(counta)

Submission status: Runtime Error

Solution code:
import numpy as np

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

# print(N - sum([np.any(P[:i+1] < P[i]) for i in range(N)]))
ar_bool = (P >= P.reshape(-1,1))
counta = 0
for i in range(N):
    counta += np.any((ar_bool)[i][:i+1])
print(counta)

Submission status: Runtime Error

Solution code:
import numpy as np

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

# print(N - sum([np.any(P[:i+1] < P[i]) for i in range(N)]))
ar_bool = (P < P.reshape(-1,1))
for i in range(N):
    N -= np.any((ar_bool)[i][:i+1])
print(N)

Submission status: Runtime Error

Solution code:
import numpy as np

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

# print(N - sum([np.any(P[:i+1] < P[i]) for i in range(N)]))
for i in range(N):
    N -= np.any((P < P.reshape(-1,1))[i][:i+1])
print(N)

Submission status: Runtime Error

Solution code:
import numpy as num
N=int(input())
P=list(map(int,input().split()))
count=0
flag=True
for i in range(N):
    for k in range(1):
        l=np.amin(np.array(P[:i+1]))
        if P[i]>l:
            flag=False
            break
    if flag:
        count+=1
    else:
        flag=True
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

cnt = 0
for i in range( 1, len( p )+1):
  p_2 = p[ : i ]
  print( p[i-1], p_2 )
  if p[i-1] == min( p_2 ):
    cnt += 1
print( cnt )

Submission status: Runtime Error

Solution code:
import numpy as np

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

# print(N - sum([np.any(P[:i+1] < P[i]) for i in range(N)]))
for i in range(N):
    N -= np.any(P < P.reshape(-1,1))[i][:i+1]
print(N)

Submission status: Runtime Error

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

ans = 1
flag = True

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

print(ans)