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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  ans=1
  a=l[0]

  for x in l[1:]:
    if a>x:
      ans+=1
    if a>x:
      a=x

  return ans


print(main())

Solution (Python):
import sys

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))

n = int(input())
Arr = get_array()
ans = 0
mini = float('inf')
for i in range(n):
    mini = min(mini, Arr[i])
    if Arr[i]==mini:
        ans+=1
print(ans)

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

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

Solution (Python):
n=int(input())
arr=[int(x) for x in input().split()]
mn=arr[0]
ans=1
for x in range(1,n):
	if arr[x]<mn:
		mn=arr[x]
		ans+=1
print(ans)

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

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

print(ans)

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

idx = p[0]
ans=0
for i in range(n):
    if idx >= p[i]:
        ans+=1
        idx = p[i]

print(ans)

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

Solution (Python):
import sys
import fractions
import math
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

tmp = MAX_INT
ans = 0
for i in range(N):
  if a[i] <= tmp:
    ans += 1
    tmp = a[i]
print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
tmp = float('inf')
cnt = 0
for i in range(N):
	if P[i] <= tmp:
		cnt += 1
	tmp = min(tmp, P[i])

print(cnt)

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

ans = 0
top = N*2
for i in range(N):
    top = min(top, A[i])
    if A[i] <= top:
        ans += 1

print(ans)

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

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]
ans = 0
n = 999999999
for p in P:
    if p < n:
        ans += 1
        n = p
print(ans)

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

minimum = float('inf')

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

print(count)

Solution (Python):
N = int(input())
ps  = list(map(int, input().split()))
m = 10**10
cnt = 0
for p in ps:
    if p < m:
        cnt += 1
        m = p
print(cnt)

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

mn = n
cnt = 0
for e in p:
    mn = min(mn, e)
    if mn >= e:
        cnt += 1

print(cnt)

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

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

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

m = N+1
ans = 0
for p in P:
  m = min(m, p)
  if p<=m:
    ans += 1
print ans

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline

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

    ans = 0
    m = 10**10
    for i in range(N):
        if A[i] < m:
            ans += 1
            m = A[i]
    print(ans)


if __name__ == '__main__':
    main()

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

cnt = 1
temp = P[0]
for p in P[1:]:
    if temp > p:
        temp = p
        cnt+=1
print(cnt)

Solution (Python):
import sys
input = sys.stdin.readline
import itertools

N = int(input())
a = list(map(int,input().split()))
mi = 10**9
res = 0
for i in range(N):
    if a[i] < mi:
        res += 1
        mi = a[i]
print(res)

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

ans = 0
min_pi = p[0]
for pi in p:
  if pi <= min_pi:
    ans += 1
    min_pi = pi

print(ans)

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

M = float('inf')
ans = 0
for p in P:
    if M > p:
        ans += 1
    M = min(M, p)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))

aa = 0
ans = float("inf")
for i in range(n):
    if A[i] < ans:
        aa += 1
        ans = A[i]
print(aa)

Solution (Python):
_,p=open(0)
m=10**18
c=0
for p in map(int,p.split()):
    c+=p<m
    m=min(m,p)
print(c)

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

m = p[0]

ans = 0

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

Solution (Python):

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

Solution (Python):
N = int(input())
*P, = map(int, input().split())
ans = 0
current_min = 10**10
for p in P:
    if p < current_min:
        ans += 1
        current_min = p
print(ans)

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

Solution (Python):

N = int(input())

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

m = float("inf")
ans = 0

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

print (ans)

Solution (Python):
import sys
input=sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n=INT()
p=LIST()
cnt=1
pre=p[0]
for i in range(1,n):
    if pre>p[i]:
        cnt+=1
        pre=p[i]
print(cnt)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
m = N+1
ans = 0
for p in P:
    if p<=m:
        ans += 1
        m=p
print(ans)

Solution (Python):
def main():
    n = input()
    pp = map(int, raw_input().split())
    c = 1
    m = pp[0]
    for p in pp[1:]:
        if m >= p:
            c += 1
            m = p
    print c


main()

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
m = 10**6
ans = 0
for p in P:
    if m >= p:
        ans += 1
        m = p
print(ans)

Solution (Python):
n = int(input())
ps = [int(v) for v in input().split()]

local_min = 10 ** 7
count = 0
for p in ps:
    if p <= local_min:
        count += 1
        local_min = p

print(count)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    mn=10**10
    n=II()
    aa=LI()
    ans=0
    for a in aa:
        if a<mn:ans+=1
        mn=min(a,mn)
    print(ans)
main()

Solution (Python):
def main():
    inf = float('inf')

    n = int(input())
    *p, = map(int, input().split())

    ma = inf
    ret = 0
    for x in p:
        if x <= ma:
            ret += 1
            ma = x
    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
lists=list(map(int,input().split()))
a=1
big=lists[0]
for i in range(1,len(lists)):
    if lists[i]<=big:
        a+=1
        big=lists[i]
print(a)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]

min_A = N+1
count = 0
for i in range(N):
    if A[i] < min_A:
        count += 1
        min_A = A[i]
        
print(count)

Solution (Python):
n, *a = map(int, open(0).read().split())
mn = 1e7
ans = 0
for i in range(n):
    if a[i]<=mn:
        ans += 1
        mn = a[i]
print(ans)

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

Solution (Python):
N = int(input())
Ps = list(map(int,input().split(" ")))
mi = 10 ** 10
ans = 0
for p in Ps:
    if p <= mi:
        mi = p
        ans += 1
print(ans)

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    lp = rli()
    m = n+1
    ans = 0
    for p in lp:
        if p <= m:
            ans += 1
        m = min(m, p)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
p = list(map(int, input().split()))
M = 10**18
ans = 0

for pi in p:
    if pi<=M:
        ans += 1
        M = pi

print(ans)

Solution (Python):
a = int(input())
l = list(map(int,input().split()))
ans = 1
t = l[0]
for i in range(1,a):
    if t>l[i]:
        ans+=1
        t=l[i]
print(ans)

Solution (Python):


import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read





n = int(input())
a = [int(i) for i in readline().split()]

m = n+10
ans = 0
for i,ai in enumerate(a):
    m = min(m,ai)
    if m==ai:
        ans += 1

print(ans)

Solution (Python):
n = int(input())
P = list(map(int, input().split()))
m = float("inf")
ans = 0
for i in P:
  if m > i:
    m = i
    ans += 1
print(ans)

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

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

class Binary_Indexed_Tree():
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)

    def add(self, i, x):
        while i <= self.n:
            self.data[i] += x
            i += i & -i

    def sum(self, i):
        ret = 0
        while i:
            ret += self.data[i]
            i &= i-1
        return ret

ans= 0
BIT = Binary_Indexed_Tree(n+1)
for i in range(n):
    BIT.add(p[i], 1)
    if BIT.sum(p[i]-1) == 0:
        ans += 1
print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): 
    return int(input())
def inpm(): 
    return map(int,input().split())
def inpl(): 
    return list(map(int, input().split()))
def inpls(): 
    return list(input().split())
def inplm(n): 
    return list(int(input()) for _ in range(n))
def inpll(n): 
    return [list(map(int, input().split())) for _ in range(n)]

def main():
    n = inp()
    p = inpl()
    ans = 0
    m = 10**6
    for i in range(n):
        if m > p[i]:
            m = p[i]
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))



N = I()
P = III()

pmin = P[0]
count = 1
for i in range(1,N):
    if P[i]<=pmin:
        count += 1
        pmin = P[i]
    else:
        continue

print(count)

Solution (Python):
N = int(input())
P = list(map(int,input().split()))
now = P[0]
ans = 0
for e in P:
    if now >= e:
        ans += 1
    now = min(now,e)
print(ans)

Solution (Python):
N = int(input())
P = [int(i) for i in input().split()]

ans = 0
m = 10**6

for p in P:
    if p <= m:
        ans += 1
        m = p

print(ans)

Solution (Python):

from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

def main():
    n = ii()
    p = li()
    m = p[0]
    cnt = 0
    for i in p:
        m = min(i,m)
        if m == i:
            cnt+=1

    print(cnt)
        



main()

Solution (Python):
N = int(input())
A = [int(n) for n in input().split()]
minimum = 10**7
res = 0
for a in A:
    if a < minimum:
        res += 1
        minimum = a
print(res)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
p = LI()
tmp = inf
ans = 0
for i in range(n):
    if tmp > p[i]:
        ans += 1
        tmp = p[i]
print(ans)

Solution (Python):
N=int(input())
P=[int(i) for i in input().split()]
c=0
min_=P[0]
for i in range(N):
    if P[i]>min_:
        pass
    else:
        c+=1
        min_=P[i]
print(c)

Solution (Python):
def main():
    n = int(input())
    p = list(map(int, input().split()))

    m = 10**6
    cnt = 0
    for i in range(n):
        if p[i] < m:
            cnt += 1
        m = min(m, p[i])
    print(cnt)


main()

Solution (Python):

import sys
INF = float("inf")


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

    count = 0
    m = INF
    for p in P:
        if m > p:
            count += 1
            m = p
    print(count)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    P = [int(next(tokens)) for _ in range(N)]  
    solve(N, P)


if __name__ == '__main__':
    main()

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

minP = N+1
ans = 0
for P in Ps:
    if P <= minP:
        ans += 1
        minP = P

print(ans)

Solution (Python):
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n = ri()
ls = ril()
res = 0
minval = float('inf')
for x in ls:
    if x < minval:
        res += 1
        minval = x
print(res)

Solution (Python):
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))

ans = 0
now_min = A[0]

for a in A:
  if now_min >= a:
    ans += 1
  now_min = min(now_min, a)
  
print(ans)

Solution (Python):
N = int(input())
P = list(map(int, input().split()))
m = 10**9
ans = 0
for p in P:
    if p < m:
        m = p
        ans += 1
print(ans)

Solution (Python):
n = int(input())
p = [int(i) for i in input().split()]
m = max(p)+1
c = 0
for num in p:
    if num < m:
        c += 1
        m = num
print(c)

Solution (Python):

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

INF = 1<<30
ans = 0
minv = INF
for p in P:
    if p<=minv:
        minv = p
        ans += 1
print(ans)

Solution (Python):

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

cnt = 0
m = N+1
for p in P:
    if m >= p:
        m = p
        cnt += 1

print(cnt)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
res = 0
for i in range(n):
    if i == 0:
        res += 1
        m = a[i]
        continue
    if m > a[i]:
        res += 1
        m = a[i]
print(res)

Solution (Python):
N = int(input())
p = [int(c) for c in input().split()]
ans = 1
a = p[0]
for i in range(1, N):
  if p[i]<=a:
    ans += 1
    a = p[i]
print(ans)

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
mi = 1e9
ans = 0
for i in range(n):
  if mi >=p[i]:
    ans += 1
  mi = min(mi, p[i])
print(ans)

Solution (Python):
N = int(input())
listP = list(map(int, input().split(' ')))

cnt = 0
minP = 2 * (10 ** 5)
for i in listP:
  if i <= minP:
    cnt += 1
    minP = i

print(cnt)

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

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

Solution (Python):
n = int(input())
arr = list(map(int,input().split()))


temp_min = arr[0]
ans = 0
for i in range(n):
    if arr[i] <= temp_min:
        temp_min = arr[i]
        ans += 1
    else:
        continue

print(ans)

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

MIN=1<<30
ANS=0

for p in P:
    MIN=min(p,MIN)
    if p<=MIN:
        ANS+=1
print(ANS)

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

tmp = 10**9

ans = 0
for i in range(n):
    if tmp >= p[i]:
        ans += 1
        tmp = p[i]

print(ans)

Solution (Python):


from collections import deque, defaultdict
import itertools as ite
import sys
import math
from decimal import *

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
P = map(int, raw_input().split())
cur = N + 1
ans = 0
for num in P:
    if num < cur:
        ans += 1
        cur = num
print ans

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


ans = 0
now = float('inf')
for i in range(N):
    if now > P[i]:
        now = P[i]
        ans += 1
print(ans)

Solution (Python):
N = int(input())
mi = N + 1
ans = 0
for p in [int(a) for a in input().split()]:
    if p < mi:
        ans += 1
        mi = p
print(ans)

Solution (Python):
n=int(input())
p=[int(j) for j in input().split()]
t=10**18
ans=0
for i in p:
    if i<=t:
        ans+=1
        t=i
print(ans)

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split()))
    m = N + 1
    r = 0
    for p in P:
        if p < m:
            r += 1
        m = min(m, p)
    print(r)
    

main()

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

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

Solution (Python):
N=int(input())
P=[int(i) for i in input().split(" ")]

minimum=10**10
retval=0
for p in P:
    if p<minimum:
        minimum=p
        retval+=1

print(retval)

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

Solution (Python):
n=int(input())
P=[int(i) for i in input().split()]
cur=n+1
ans=0
for p in P:
  if p<cur:
    ans+=1
    cur=p
print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
P = np.array(read().split(),np.int32)

Q = np.minimum.accumulate(P)

answer = np.count_nonzero(P <= Q)

print(answer)

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

Solution (Python):
def main():
    N = int(input())
    P = list(map(int, input().split()))
    mn = N+1
    ans = 0
    for p in P:
        if p < mn:
            mn = p
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

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

mn = 10**6
ans = 0
for p in P:
  if p < mn:
    ans += 1
    mn = p
print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
P = LIST()

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

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
mini = 1999999
ans = 0
for i in range(n):
    if mini > p[i]:
        ans += 1
        mini = p[i]
print(ans)

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

ans = 0
m = float("inf")
for i in p:
    if i <= m:
        ans += 1
    m = min(m, i)

print(ans)

Solution (Python):
import sys
from collections import deque
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations
from bisect import bisect, bisect_left

def solve():
    input = sys.stdin.readline
    N = int(input())
    P = [int(p) for p in input().split()]
    minN = P[0]
    count = 1
    for p in P[1:]:
        if minN > p:
            count += 1
            minN = p

    print(count)

    return 0

if __name__ == "__main__":
    solve()

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

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

Solution (Python):
n = int(input())
p = list(map(int, input().split()))
m = n + 1
ans = 0
for x in p:
    if x < m:
        ans += 1
        m = x
print(ans)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    now = inf
    ans = 0
    for a in A:
        if a<=now:
            ans+=1
            now = a
    print(ans)
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
p = list(map(int,input().split()))
ans = 0
q = p[0]
for i in range(n):
    if q >= p[i]:
        ans += 1
        q = min(q,p[i])

print(ans)

Solution (Python):
N = int(input())
P = [int(x) for x in input().split()]

m = 10 ** 6
ans = 0
for i in range(N):
    if m >= P[i]:
        ans += 1
        m = P[i]
print(ans)

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

m = 10**6
ans = 0
for p in P:
    if p < m:
        m = p
        ans += 1
print(ans)

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    p = LI()
    ans = 1
    min = p[0]
    for i in p[1:]:
        if i < min:
            ans += 1
            min = i
    print(ans)
    return


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
mn = 10 ** 100
res = 0
for i in a:
    if i <= mn:
        res += 1
    mn = min(mn, i)
print(res)

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


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

P = np.array(P, dtype=int)
ans = (P == np.minimum.accumulate(P)).sum()
print(ans)

Solution (Python):
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 9
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())


N = inp()
PP = inpl()

m = INF
ans = 0
for p in PP:
    if m > p:
        ans += 1
    m = min(m,p)

print(ans)