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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

cnt = 0
for i in range(n):
    if p[i] <= np.max(p[:i+1]):
    # if all(map(lambda pj: p[i] <= pj, p[:i + 1])):
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

print(p)
cnt = 0
for i in range(n):
    if p[i] <= np.max(p[:i+1]):
    # if all(map(lambda pj: p[i] <= pj, p[:i + 1])):
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

print(p)
cnt = 0
for i in range(n):
    if all(map(lambda pj: p[i] <= pj, p[:i + 1])):
        cnt += 1
        if p[i] == 1:
            break


print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int, input().split()))
ans=0
min=2*100000
for i in range(n):
    num_now=l[i]
    if num_now<min:
        ans+=1
        min=num_now
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int, input().split()))
ans=0
min=2*100000
for i in range(n):
    num_now=l[i]
    if num_now<min:
        ans+=1
print(ans)

Submission status: Wrong Answer

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: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=[int(i) for i in input().split()]
ans=0
k=10*9+7
for i in range(a):
  if k>=b[i]:
    ans+=1
    k=b[i]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1,n):
  if p[i] < p[i-1]:
    count += 1
print(count)

Submission status: Wrong Answer

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

q = p[0]
p = p[1:]

m = 1

if n > 1:
    for pi in p:
        if q > pi:
            print(pi)
            m += 1
            q = pi

print(m)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(n, P):
  max_val = P.pop(0)
  count = 1
  for p in P:
    if max_val >= p:
      count += 1
    if max_val < p:
      max_val = p
  return count

_n = int(input())
_P = list(map(int, input().split()))
print(solve(_n, _P))

Submission status: Wrong Answer

Solution code:
def solve(n, P):
  max_val = 1
  count = 0
  for p in P:
    if max_val >= p:
      count += 1
    if max_val < p:
      max_val = p
  return count

_n = int(input())
_P = list(map(int, input().split()))
print(solve(_n, _P))

Submission status: Wrong Answer

Solution code:
def solve(n, P):
  max_val = 1
  count = 0
  for p in P:
    if max_val >= p:
      count += 1
    if max_val < p:
      max_val = p
  return count

_n = int(input())
_P = list(map(int, input().split()))
print(_n, _P)

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 0
m = N
for p in reversed(P):
  if p <= m:
    count += 1
    m = p
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

  if max1<i:
    max1=i
  elif max2>=i:
    cnt=cnt+1
    max2=i     
print(cnt)

Submission status: Wrong Answer

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

  if max1<i:
    max1=i
  if max2>=i:
    cnt=cnt+1
    max2=i     
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
p=input().split()
cnt=1
max1=p[0]
max2=p[0]
for i in p:

  if max1<i:
    max1=i
  if max2>i:
    cnt=cnt+1
    max2=i     
print(cnt)

Submission status: Wrong Answer

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

memory = []

count = 0

for i in reversed(range(N)):
    if i in memory:
        continue
    for j in reversed(range(i + 1)):
        if Ps[i] > Ps[j]:
            memory.append(j)
            break
        if i == j:
            count+=1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#output
answer = 1

for i in range(N-1):
    if P[i] > P[i+1]:
        answer += 1
print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.reverse()
dp = [0] * (n+1)

res = 0
for i in range(n):
    dp[i+1] = 1
    for j in range(1, i):
            if a[j] < a[i]:
                dp[i+1] = max(dp[i+1], dp[j] + 1)

print(dp[n])

Submission status: Wrong Answer

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

dp = [0] * n

for i in range(n):
    dp[i] = 1
    for j in range(0, i):
            if a[j] >= a[i]:
                dp[i] = max(dp[i], dp[j] + 1)

print(max(dp))

Submission status: Wrong Answer

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

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: Wrong Answer

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

def code(n,p):
  answer = 0
  for idx, pp in enumerate(p):
    if pp>n:
      answer = idx+1
      
  return idx

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

Submission status: Wrong Answer

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)
if idx == None:
  print(n)
else:
  print(idx)

Submission status: Wrong Answer

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: Wrong Answer

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

prev_min = 10 ** 9
result = 0
for n in nums:
  if prev_min < n:
    break
  result += 1
  prev_min = min(prev_min, n)

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = P[0]
ans = 0

for i , val in enumerate(P):
    if i == 0:
        ans += 1
    else:
        if val <= x:
            val = x
            ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max = 0
ans = 0
for i,num in enumerate(array):
    if num > max:
        max = num
    else:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(len(q))

Submission status: Wrong Answer

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])
if p[int(n)-1]!=min(p):
    q.pop(-1)
print(q)

Submission status: Wrong Answer

Solution code:
n = input()
l = input().split()
m = 0
for i,li in enumerate(l,1):
    m += li <= min(l[:i])
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min = 2*(10**5)
cnt = 0

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

Submission status: Wrong Answer

Solution code:
nums = map(int, input().split())
count = 0
min_sofar = float('inf')
for num in nums:
  if num <= min_sofar:
    count += 1
    min_sofar = num
print(count)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = max(P)
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = input().split()
ppp = list(map(int, m))
max = 2*10**5
ans = 0
for p in ppp:
    if p < max:
        ans += 1
        max = p
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in ar:
  if int(i) >= 1 and int(i) <= n:
    c += 1
print(c)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
n = int(input())
arr = input().split(' ')
arr = [int(i) for i in arr]
count = 0
for idx in range(n):
  num = arr[idx]
  comp = sorted(arr[:idx+1])
  if num < comp[-1]:
    count += 1
print(count)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int, input().split()))
Min=2*(10**5)
ans=0
for i in S:
  if Min>i:
    Min=i
    ans+=1
    
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=list(map(int, input().split()))
Min=10
ans=0
for i in S:
  if Min>i:
    Min=i
    ans+=1
    
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a = input().rstrip().split(' ')
b=[int(i) for i in a]
count=0
for i in range(n):
    if i==n-1:
        continue
    else:
        x=b[i+1]-b[i]
        if x<0:
            count+=1
print(count+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = 1
for i in range(1, len(p), 1):
  if p[i] <= p[i-1]:
    s += 1

print(s)

Submission status: Wrong Answer

Solution code:
input()
cnt = 0
min_value = 200000
for x in map(int, input().split()):
  if min_value > x:
    cnt += 1
  min_value = min(x, min_value)
print(cnt)

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    arr = tuple(map(int, input().split()))
    tmp = arr[0]
    counter = 0
    for i in arr:
        if i<=tmp:
            tmp=i
            counter += 1
    print(counter)

Submission status: Wrong Answer

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

for i in range(1, n):
    for j in range(n):
        if p[i] > p[j]:
            count -= 1
            break
            
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = input().split()
count,m = 1,array[0]
for k in range(1,n):
  if array[k] < m:
    m = array[k]
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = input().split()
count,m = 1,array[0]
for k in range(1,len(array)):
    if array[k] < m:
        m = array[k]
        count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = input().split()
count = 1
for k in range(1,len(array)):
    if min(array[:k]) >= array[k]:
        count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = [int(i) for i in input().split()]
stan = 10*9+7
ans = 0
for i in range(N):
    if stan  >= P[i]:
        stan = P[i]
        ans += 1
    else:
        pass
print(ans)

Submission status: Wrong Answer

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] > 0:
        c += 1
    else:
        m = p[i]
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def lowElements(n:int , array:list):
    count = 1
    for k in range(1,len(array)):
        if min(array[:k]) >= array[k]:
            count = count + 1
    return count

Submission status: Wrong Answer

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

num = 0
for k in P:
	if k == P[N-1]:
		break
	else:
		for ii in P[P.index(k):]:
			if k < ii:
				num+=1
				break
print(num)

Submission status: Wrong Answer

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

list_parsed = []

count = 0
for elem in list_raw:

    list_parsed.append(elem)
    count += 1 if max(list_parsed) <= elem else 0

print(count)

Submission status: Wrong Answer

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

list_parsed = []

count = 0
for elem in list_raw:

    list_parsed.append(elem)
    if max(list_parsed) >= elem:
        count += 1

print(count)

Submission status: Wrong Answer

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

list_parsed = []

count = 0
for elem in list_raw:

    list_parsed.append(elem)
    if max(list_parsed) <= elem:
        count += 1

print(count)

Submission status: Wrong Answer

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

res = 1
for i in range(N-1):
    if P[i]-P[i+1]>0:
        res += 1
else:
    print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
Plist = list(map(int, input().split()))
now = Plist[0]
ans = 0
for p in Plist:
    if p <= now:
        ans += 1
    else:
        break
    now = p
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
Plist = list(map(int, input().split()))
now = Plist[0]
ans = 0
for p in Plist:
    if p <= now:
        ans += 1

    now = p
print(ans)

Submission status: Wrong Answer

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

m = 0
ans = 0
dp = [-10**9 for _ in range(N+1)]
for i in range(N):
    if dp[i] <= P[i]:
        dp[i+1] = P[i]
        m = 1
    else:
        dp[i+1] = dp[i]
        m += 1
    ans = max(m, ans)

print(ans)

Submission status: Wrong Answer

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

m = 0
ans = 0
dp = [0 for _ in range(N+1)]
for i in range(N):
    if dp[i] <= P[i]:
        dp[i+1] = P[i]
        m = 1
    else:
        dp[i+1] = dp[i]
        m += 1
    ans = max(m, ans)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dp = [0 for _ in range(N+1)]
for i in range(N):
    if dp[i] <= P[i]:
        dp[i+1] = P[i]
    else:
        dp[i+1] = dp[i]

cur = 0
prev = dp[0]
ans = 0
for i in range(N+1):
    if prev == dp[i]:
        cur += 1
        ans = max(ans, cur)
    else:
        ans = max(ans, cur)
        cur = 1
    prev = dp[i]

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = [1]
    for i in range(1,N):
        j = i - 1
        if P[i] > P[j]:
            odp.append(odp[j])
        else:
            if P[odp[j]-1] > P[i]:
                odp.append(odp[j]+1)
            else: 
                odp.append(odp[j])
    print(odp[N-1])
    
mniejsze_elementy()

Submission status: Wrong Answer

Solution code:
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = [1]
    for i in range(1,N):
        j = i - 1
        if P[i] > P[j]:
            odp.append(odp[j])
        else: 
            odp.append(odp[j]+1)
    print(odp[N-1])
    
mniejsze_elementy()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
min_num = List[0]

for i in List[1:]:
    if i < min_num:
        min_num = i
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

cnt = 0
min_num = List[0]
for i in List[1:]:
    if i < min_num:
        min_num = i
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = 8
P = [5, 7, 4, 2, 6, 8, 1, 3]

smallest_so_far = float("inf")
cnt = 0

for the_num in P:
    if the_num < smallest_so_far :
        smallest_so_far = the_num
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=1
for i in range(1,N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = input().split()
c = []
l = 0
cont = False
for i in P:
  c.append(i)
  if min(c) == i:
    l = l + 1
print(l)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=0
for i in range(N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int,input().split()))
N = a+1
ans = 0

for i in range(a):
  c = b[i]
  if c>N:
    ans += 1
    N = c

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=0
for i in range(N):
    if P[i]<mn:
        mn=P[i]
        cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=0
for i in range(N):
    if P[i]<mn:
        mn=P[i]
    if P[i]<=mn:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

flag = False
count = 0

for j in range(n):
  for i in range(j, n):
    if p[i] <= p[j]:
      flag = True
    else:
      flag = False
    
  if flag:
    count += 1
  flag = False
  
print(count)

Submission status: Wrong Answer

Solution code:
'''
5
4 2 5 1 3
'''
lens = int(input())
arrs = [int(x) for x in input().split()]
print(lens - arrs.index(max(arrs)))

Submission status: Wrong Answer

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

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


print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
P = input().split()
counter = 0
m = N
for p in P:
    if int(m) > int(p):
        counter +=1
        m = p
print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp1 = input().split()
inp2 = input().split()
a = int(inp1[0])
b = inp2
b = [int(s) for s in inp2]
ansno = a
maxno = b[0]

ii = 0
for i in b:
  if i ==0:
    continue
  if maxno < i:
    maxno = i
    ansno -= 1
    continue
  bslice = b[:ii]
  b[:ii].sort(reverse=True)
  bsort = b[:ii]
  if bslice != bsort:
    ansno -=1
    print(bslice,bsort)
    print("sort")
  ii+=1
print(ansno)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(1,n):
    if a[i-1]>a[i]:
        ans+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int,input().split()))
cnt=0
bar=10**5

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = N
min_p = P[0]
for p in P[1:N]:
  if min_p > p:
    min_P = p
  else:
    ans -=1
  
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
lists=list(map(int,input().split()))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>=li:
    mn=li
    cnt+=1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
lists=list(map(int,input().split(' ')))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
lists=list(map(int,input().split()))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = input().split()
counter = 1
m = min(P)
index = P.index(m)
for i in range(1,index+1):
    if min(P[0:i+1]) < P[i]:
        continue
    else:
        counter +=1
print(counter)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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: Wrong Answer

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

sum = [i for i in range(1,n+1)]
sum = 0.5*1/6 * n *  (2 * n * n + 2 * n + 2 * n + 1) + 0.5 * 0.5 * n * n + 0.5 * n


max = 0
count = 0
for i in range(1,n):
    if int(p[i]) >= max:
        count += 1
    if max < int(p[i]):
        max = int(p[i])
print(int((count+1)/sum))

Submission status: Wrong Answer

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

mn=2*10^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)

Submission status: Wrong Answer

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

cnt = 1
m = lst[0]

for i in lst:
  if i <= m:
    cnt +=1
    m = i
print(cnt)

Submission status: Wrong Answer

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

p_f = p[0]
c = 0

for i in p:
    if p_f >= 1:
        c +=1
        p_f = i

print(c)

Submission status: Wrong Answer

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

c = 1

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

Submission status: Wrong Answer

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

c = 1

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