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: Accepted

Solution code:
ii=lambda:int(input())
miis=lambda:map(int,input().split())
lmiis=lambda:list(map(int,input().split()))

n=int(input())
p=lmiis()

ans=0
min=10**9
for i in p:
  if i<=min:
    ans+=1
    min=i

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    P = list(map(int, input().split()))
    crnt_min = float('inf')
    res = 0
    for i, p in enumerate(P):
        if crnt_min >= p:
            res += 1
        if p < crnt_min:
            crnt_min = p
    
    print(res)
    

main()

Submission status: Accepted

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

mymin = a[0]
count = 0

for i in range(len(a)):
  if min(mymin, a[i]) == a[i]:
    mymin = a[i]
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int, input().split()))
ans_lst = []
ans_lst.append(lst[0])
for p in lst[1:]:
  if ans_lst[-1]>p:
  	ans_lst.append(p)
ans = len(ans_lst)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
number = list(map(int, input().split()))
cnt = 0
min_num = number[0]
for i in range(n):
  if min_num >= number[i]:
    cnt += 1
    min_num = number[i]
  else:
    continue
print(cnt)

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

ans = 0
m = p[0]
for x in p:
    if x <= m:
        ans += 1
    m = min(m, x)
print(ans)

Submission status: Accepted

Solution code:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

# a,b = map(int, input().split())
n = int(input())
p = list(map(int,input().split()))

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
P_list = map(int, input().split())

minimum = sys.maxsize
count = 0
for P in P_list:
    if P < minimum:
        count += 1
        minimum = P
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
p = list(map(int, input().split()))

ans = 0
m = p[0]
for x in p:
    if x <= m:
        ans += 1
    m = min(m, x)

print(ans)

Submission status: Accepted

Solution code:
def low_elements(n, arr):
    min = arr[0]
    count = 0
    for i in range(n):
        if min >= arr[i]:
            min = arr[i]
            count += 1
    return count

if __name__ == "__main__":
    n = int(input())
    arr = list(map(int, input().split(' ')))
    print(low_elements(n, arr))

Submission status: Accepted

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

c = 0
min_c = p[0]
for i in range(n):
  if min_c >= p[i]:
    c += 1
    min_c = p[i]
print(c)

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

count = 0
min = P[0]

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

print(count)

Submission status: Accepted

Solution code:

N = int(input())
P = list(map(int,input().split()))
p_min = 10**9
cnt = 0
for i in range(N):
    if p_min >= P[i]:
        cnt += 1
    p_min = min(P[i],p_min)
print(cnt)

Submission status: Accepted

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

ans=0
low=l[0]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
tmp=float("inf")
ans=0
for i in range (N):
	if tmp>L[i]:
		tmp=L[i]
		ans+=1
print(ans)

Submission status: Accepted

Solution code:


def submit():
    n = int(input())
    plist = list(map(int, input().split()))
    
    curr_min = float('inf')
    ans = 0
    for p in plist:
        if p <= curr_min:
            curr_min = p
            ans += 1

    print(ans)


if __name__ == "__main__":
    submit()

Submission status: Accepted

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

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

l = []
for x in P:
	if not l or l[-1] > x:
		l.append(x)
	else:
		l.append(l[-1])

print(len(set(l)))

Submission status: Accepted

Solution code:
import sys

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

min = P[0]
count = 0

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
from collections import Counter

# 最頻値
def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
p = list(map(int,input().split()))
p_cutted = []
p_cutted = deque(p_cutted)
min_p_cutted = p[0]
ans = 0
for i in range(n):
    p_cutted.append(p[i])
    if min_p_cutted >= p[i]:
        min_p_cutted = p[i]
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
_ = input()
p = list(map(int, input().split()))
m = float("inf")
c = 0
for i in p:
  c += i < m
  m = min(m, i)
print(c)

Submission status: Accepted

Solution code:
_ = input()
p = list(map(int, input().split()))
m = float("inf")
c = 0
for i in p:
  c += i <= m
  m = min(m, i)
print(c)

Submission status: Accepted

Solution code:
import sys
from itertools import groupby


def input():
    return sys.stdin.readline()[:-1]


def solve():
    N = int(input())
    P = list(map(int, input().split()))
    m = float('inf')
    ans = 0
    for p in P:
        if p <= m:
            ans += 1
        m = min(m, p)
    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

ok = n + 1
cnt = 0
for i in p:
    if i <= ok:
        cnt += 1
        ok = i
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    N = int(input())
    P = read_list()
    pre = P[0]
    res = 0
    for p in P:
        if pre >= p:
            res += 1
            pre = p
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
_ = int(input())
*l, = map(int,input().split())
tmpmin = 10**6
ans=0
for i in l:
  if i < tmpmin:
    ans+=1
    tmpmin = i
print(ans)

Submission status: Accepted

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

ans = 0
m = float('inf')
for i in range(n):
    m = min(m, p[i])
    if p[i] == m:
        ans +=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
now_min=float("inf")
n=int(input())
p=list(map(int,input().split()))
ans=0
for pi in p:
  if pi<=now_min:
    ans+=1
    now_min=pi
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
P =  [int(x) for x in input().split()]
min = P[0]
ans = 1
for p in P:
    if p < min:
        min = p
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n = INT()
p = LIST()
ans = 0
arr = [inf for _ in range(n)]
arr[0] = p[0]
for i in range(1, n):
    arr[i] = min(p[i], arr[i-1])
#print(arr)
for i in range(n):
    ans += 1 if arr[i] == p[i] else 0
    #print(i+1, arr, sum(arr[p[i] - 1:]), sum(arr[p[i] - 1:]) == i + 1)
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
P = list(map(int, input().split()))
count = 0
m = 1000000
for i in range(N):
  if m > P[i]:
    count+=1
    m = P[i]
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

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

a=p[0]
cnt=1

for i in range(1,n):
    if p[i]<a:
        cnt+=1
        a = p[i]

print(cnt)

Submission status: Accepted

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

num = 2*10**5+1
ans = 0
for i in range(n):
    if P[i] <= num:
        num = P[i]
        ans += 1
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=0
p_min=2*10**6

for i in P:
    p_min = min(p_min,i)
    if i <= p_min:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
key = n
ans = 1
for i in range(n):
  if i == 0:
    key = a[i]
    continue
  if a[i] < key:
    ans += 1
    key = a[i]
print(ans)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    m = 10 ** 9
    ans = 0
    for a in A:
        m = min(m, a)
        if m >= a:
            ans += 1
    return ans

print(solve())

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    a = list(map(int,input().split()))

    mina = 2*(10**5)
    ans = 0
    for i in range(n):
        mintest = min(a[i], mina)
        if mintest >= a[i]:
            ans += 1
            mina = mintest
    print(ans)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

    _min_p = p[0]
    count = 0
    for _p in p:
        if _min_p >= _p:
            count += 1
        _min_p = min(_min_p, _p)

    print(count)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
min_n = 0
for i in range(len(p)):
    if i==0:
        ans += 1
        min_n = p[i]
    else:
        if p[i] <= min_n:
            ans += 1
            min_n = p[i]
        else:
            pass

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
p = [int(s) for s in input().split()]
mp = 200000
ct = 0
for x in range(n):
  if p[x] <= mp:
    mp = p[x]
    ct += 1
print(ct)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
mi=10**9
cnt=0
for i in range(n):
  if l[i]<mi:
    mi=min(mi,l[i])
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
mi=10**9
mi_lst=[]
cnt=0
for i in range(n):
  if l[i]<mi:
    mi_lst.append(l[i])
    mi=min(mi,l[i])
    cnt+=1
  else:mi_lst.append(l[-1])
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x,y=0,l[0]
for i in range(n):
    y=min(y,l[i])
    if l[i]<=y:
        x+=1

print(x)

Submission status: Accepted

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

x=0
y=[]
z=l[0]
for i in range(n):
    #y=y+[l[i]]
    z=min(z,l[i])
    if l[i]<=z:
        x+=1
print(x)

Submission status: Accepted

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

# N = 5
# P = [4, 2, 5, 1, 3]

ans = 0
min = 2 * 10**5
for i in range(0, N):
    # i = 1
    if min > P[i]:
        min = P[i]
    if P[i] <= min:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

s = 1
t = p[0]
for i in range(1,n):
  if p[i] <= t:
    s += 1
    t = p[i]
print(s)

Submission status: Accepted

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

for i in range(N):
    if i == 0:
        count += 1
        minimum = P[i]
        continue
    if minimum >= P[i]:
            count += 1
            minimum = P[i]

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

for i in range(n):
    if p[i] <= maxN:
        sumN += 1
        maxN = p[i]
        if maxN == 1:
            break

print(sumN)

Submission status: Accepted

Solution code:
n = int(input())

p = [int(s) for s in input().split()]
flag = -1
m_ans = 1
p_z = p[0]
for i in range(1,n):
    p_z = min(p_z,p[i])
    if(p_z >= p[i]):
        #print(p[j],p[i])
        m_ans += 1
    
print(m_ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
p = np.array(list(int(x) for x in input().split()))
sum = 0
low = p[0] + 1

for i in p:
    if(i < low):
        sum += 1
        low = i

print(sum)

Submission status: Accepted

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

current_min = float("inf")
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    N = II()
    P = LMIIS()
    count = 0
    min_p = P[0]
    for p in P:
        if p <= min_p:
            count += 1
            min_p = p
    print(count)


    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
m = [0]*N
s = input()
m = s.split()
c = 99999999
k = 0
for i in range(N):
	m[i] = int(m[i])
	if m[i] <= c:
		c = m[i]
		k +=1

print(k)

Submission status: Accepted

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

if n == 1:
    print("1")
else:
    for i in range(1, n):
        if last_min >= perputation[i]:
            cnt += 1
            last_min = perputation[i]
    print(cnt)

Submission status: Accepted

Solution code:
def low_element(p):
    min = 2*10**5+1
    c = 0
    for p_i in p:
        if p_i <= min:
            min = p_i
            c += 1
    return c

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

print(low_element(p))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

mn = p[0]
ans = 0
for e in p:
    mn = min(mn, e)
    if e <= mn:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 1
mark = ps[0]
for p in ps[1:]:
    if mark >= p:
        cnt += 1
        mark = p

print(cnt)

Submission status: Accepted

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

cnt = 0
mark = ps[0]
for p in ps:
    if mark >= p:
        cnt += 1
        mark = min(mark, p)

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  4 17:57:43 2020

@author: Kanaru Sato
"""

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

Min = P[0]
count = 1

for i in range(1,N):
    if Min >= P[i]:
        count += 1
        Min = P[i]

print(count)

Submission status: Accepted

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

sum = 0
min = n
for i in range(n):
  if min >= P[i]:
    min = P[i]
    sum += 1
    
print(sum)

Submission status: Accepted

Solution code:
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]
    else:
        pass
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

current_min = float("inf")
ans = 0
for n in P:
    if n <= current_min:
        current_min = n
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
list_score = list(map(int, input().split()))
min_value = list_score[0]
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
FIRST_MIN_VALUE = 20000000

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

"""
初期戦略
for で一個ずつ回していくのはきつい気がする。
N <= 2*10**5だし、
まあ一回やってみるか
MIN_VALUEを更新して行ってカウントアップしていく
"""

min_val = FIRST_MIN_VALUE
count = 0
for p in P:
  if p <= min_val:
    min_val = p
    count += 1

print(count)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline

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

    #result = list()

    minimum = P[0]
    count = 1
    for i in range(N):
        if(minimum > P[i]):
            minimum = P[i]
            count += 1
    print(count)
#        Pj = list(P[j] for j in range(i+1))
        #print(Pj)
        #Pj = P[0:i+1]
#        min_P = min(Pj)
#        result.append(min_P)
#        print(min_P)
#        if(P[i] == min_P):
#            count += 1

    '''
    count = 0
    flag = True

    for i in range(N):
        for j in range(i):
            if(P[i] > P[j]):
                flag = False
                break
        if(flag):
            count += 1
        flag = True
    print(count)
    '''

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

min_num = 2 * (10**5) + 1
count = 0

for v in p:
  if v < min_num:
    count += 1
    min_num = v
    
print(count)

Submission status: Accepted

Solution code:
n = int(input())
p_ls = list(map(int,input().split()))
min_ = float('inf')
count = 0
for i in range(n):
    if p_ls[i] < min_:
        count += 1
        min_ = p_ls[i]
print(count)

Submission status: Accepted

Solution code:
N = int(input())
P = [int(i) for i in input().split(" ")]
count = 0
pmax = max(P)
for i in range(N):
    if P[i]<= pmax:
        pmax=P[i]
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# import math
# from fractions import gcd

import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
arrP = np.array(input().split(),dtype=np.int64)

minnum = arrP[0]

def func152C(arr,minnum):
    ans = 0
    for i in arr:
        if i <= minnum:
            minnum = i
            ans += 1
        else:
            continue
    return  ans

ans = func152C(arrP,minnum)
print(ans)

Submission status: Accepted

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

x = sum(p)
y = 0
for i in p:
  if x >= i:
    x = i
    y += 1
print(y)

Submission status: Accepted

Solution code:


N = int(input())
P = list(map(int,input().split()))
ans = 0
m = 10**9
for i in range(N):
    if P[i]<=m:
        ans += 1
        m = P[i]
    else:
        pass
print(ans)

Submission status: Accepted

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

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)

Submission status: Accepted

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

total = 0
minl = l[0]

for i in l:
    if i <= minl:
        total += 1
        minl = i

print(total)

Submission status: Accepted

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

ans = 0
min = 2*10**5+1
for i in range(n):
    if p[i] < min:
        min = p[i]
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
Min = l[0]
count = 0

for i in range(n):
    if Min >= l[i]:
        Min = l[i]
        count += 1
        
print(count)

Submission status: Accepted

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

count = 0
minn = xlist[0]

for i in range(0,n):
    if minn >= xlist[i]:
        count += 1
        minn = xlist[i]
    else:
        pass

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
P = list(map(int,input().split()))
count = 1
 
if N > 0:
  min = P[0]
  
for i in range(1, N):
  isbreak = False
  
  if min < P[i]:
    continue
  elif min >= P[i]:
    min = P[i]
    count += 1
    continue  
  for j in range(0,i):
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    count += 1
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = list(map(int,input().split()))
str_min = p[0]
count = 0
for digit in p:
    if digit <= str_min:
        str_min = digit
        count += 1
print(count)

Submission status: Accepted

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

count=0
mi=P[0]  #minimum

for i in range(N):
    A=P[i]
    if A<=mi:
        mi=A
        count+=1
    else:
        continue

print(count)