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:
import numpy as np

#a, b = map(int, input().split())
N = int(input())

#map(int, input().split())

# def bubble_sort(lst):
#     cnt = 0
#     for i in range(len(lst)-1):
#         for j in range(len(lst)-1, i, -1):
#             if lst[j-1] > lst[j]:
#                 tmp = lst[j]
#                 lst[j] = lst[j-1]
#                 lst[j-1] = tmp
#                 cnt += 1
#     return cnt

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

cnt = 1

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

Submission status: Wrong Answer

Solution code:
n = input()
p = input().split()

cnt = int(n)

for i in range(int(n)):
    if i != 0:
        for j in range(i):
            if p[i] > p[j]:
                cnt = cnt - 1
                break

print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np

N=int(input())

P=np.array(input().split(" "),dtype=np.int32)

count=1

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = int(input())

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

l = []

for i in range(n):
    l.append([i+1, p[i]])

l.sort(key = lambda x : -1*x[1])

ans = 0

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

Submission status: Wrong Answer

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

c = [True for i in range(n)]
for i in range(1,n):
  pmod = sorted(p[0:i])
  if p[i]>pmod[-1]:
      c[i] = False
print(sum(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1

for i in range(1,len(k)):
  if k[i-1] > k[i]:
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
P  =  [int(x) for x in input().split()]
j = 0
count = 0

if len(P) <= N:
    for num in P:
        try:
            j = j + 1
            i = num - P[j]
            if i < 0 and count <= num:
                count = count + 1
        except:
           count = count + 1

print(count)

Submission status: Wrong Answer

Solution code:
def Convert(string): 
    li = list(string.split(" ")) 
    return li 

N = input().split()
L = Convert(input())
Min = L[0]
Sum = 0

for i in L:
    if i <= Min:
        Sum += 1
        Min = i

print(Sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = input().rstrip().split()
P = [0] * N
for i in range(N):
  P[i] = int(a[i])
minP = P[0]
ans = 1
for i in range(N - 1):
  if P[i] >= P[i + 1]:
    ans += 1
    minP = P[i + 1]
print(ans)

Submission status: Wrong Answer

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

for i in range(N):
    for l in range(i):
        data = min(li[l],li[i])
    if data == li[i]:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_L = sorted(p_L,reverse=True)

ans = 0
for i in range(n):
    if p_L[i] - a_L[i] <= 0:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

count = 1

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

print (count)

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = [int(num) for num in input().split()]

counter = 1

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

print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int,input().split()))
li = [0]*n
sta = 1

for i in range(n):
  if p[i] < sta:
    li[i]=1
  else:
    sta = p[i]

print(sum(li))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
m=input()
P=[]
for i in range(N):
  P.append(int(m.split()[i]))
count=0
if(N==1):
  print(1)
else:
  for i in range(N-1):
    if(P[i]>P[i+1]):
      count+=1
  print(count+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [int(var) for var in input().split()]

temp = []

for i in range(len(lst)):
  if lst[i] == 1:
    temp.append(lst[i])
  elif lst[i] > 1:
    try:
      if lst[i] <= lst[i+1]:
        temp.append(lst[i])
    except:
      break

print(len(temp))

Submission status: Wrong Answer

Solution code:
n = int(input())
seq = list(map(int,input().split()))
ans = 1
minim = n

for i in range(1, len(seq)):
    minim = min(minim, seq[i-1])
    print(minim)
    if minim > seq[i]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = [int(var) for var in input().split()]

temp = []

for i in range(len(lst)):
  if lst[i] == 1:
    temp.append(lst[i])
  elif lst[i] > 1:
    try:
      if lst[i] >= lst[i+1]:
        temp.append(lst[i])
    except:
      break

print(len(temp))

Submission status: Wrong Answer

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

a_L = sorted(p_L)

ans = 0
for i in range(n):
    if p_L[i] - a_L[i] <= 0:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

ans = [1]
for i in range(1,len(P)):
    if P[i] >= P[i-1]:
        continue
    else:
        ans.append(i+1)

print(len(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

p_n = list(input().split())

result = 0
min_tmp = p_n[0]
for x in range(N):
    if p_n[x] <= min_tmp:
        result += 1
        min_tmp = p_n[x]
    else:
        min_tmp = min(min_tmp,p_n[x])

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = input().rstrip().split()
P = [0] * N
for i in range(N):
  P[i] = int(a[i])
minP = P[0]
ans = 1
for i in range(N - 1):
  if P[i] > P[i + 1]:
    ans += 1
    minP = P[i + 1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int,input().split()))
count = 0
max_num = L[0]

if N == 1:
    print(1)

else:
    for i in range(1,N):
        max_num = max(L[i-1],max_num)
        if L[i] <= max_num:
            count = count+1
    
    print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
lst = [ int(ele)for ele in input().split()]
lst = [n]+lst
t=0
for i in range(1,len(lst)):
    if lst[i]<=lst[i-1]:t+=1
print(t)

Submission status: Wrong Answer

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline--------------------------------------------
    n = int(input())
    p = list(map(int,input().split()))
    ans = 1
    for i in range(n-1):
        if p[i+1] < p[i]:
            ans += 1
    print(ans)
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

min = 2 * 100000
counter = 0
for i in list(map(int, input().split())):
    if (min > i):
        min = i
        counter += 1

print(counter)

Submission status: Wrong Answer

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

ll = []
ll.append(l[0])

for i in range(len(l)-1):
  if l[i] > l[i+1]:
    ll.append(l[i+1])
  else:
    ll.append(ll[i])

count = 0
for i in range(len(ll)):
  if l[i] <= ll[i]:
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

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

print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 21:01:18 2020

@author: over-
"""

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

c=1
m=int(P[0])
for i in range(1,N):
    if int(P[i-1])>int(P[i]):
        c+=1
        m=int(P[i])


print(c)

Submission status: Wrong Answer

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

q=[p[0]]
for i in range(n):
  q.append(q[i-1]+p[i])
ans=1
for i in range(1,n):
  if q[i]>=p[i]*(i+1):
    if i==n-1:
      if p[i]==1:
        ans+=1
      else:
        ans-=1
      continue
    # print(i,q[i],p[i]*(i+1))
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
    elif P[i - 1] < P[i]:
          pass  
    elif Pi == min(P):
        count = count +1
        break
    elif Pi<= min(P[0:i]):
        count = count +1
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = input().split()
ll = []
a = 1
c = 0
for i in l:
  k = i
  ll.append(k)
  if c == 0:
    m = k
  elif m > k:
    m = k
    a += 1
  c +=1
print(a)

Submission status: Wrong Answer

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

ans = [1]
for i in range(1,len(P)):
    if P[i] > P[i-1]:
        continue
    else:
        ans.append(i+1)

print(len(ans))

Submission status: Wrong Answer

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

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
P  =  [int(x) for x in input().split()]
j = 0
count = 0

if len(P) <= N:
    for i in P:
        try:
            j = j + 1
            i = i - P[j]
            if i < 0:
                count = count + 1
        except:
           count = count + 1

print(count)

Submission status: Wrong Answer

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

count = 1

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

print (count)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int,input().split()))
P_min = [2*(10**5),]
for i in range(N-1):
    P_min.append(min(P_min[i-1],P[i]))
#print(P_min)
ans = 0
for i in range(N):
    if P_min[i] >= P[i]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
m=input()
P=[]
for i in range(N):
  P.append(int(m.split()[i]))
count=0
for i in range(N-1):
  if(P[i]>P[i+1]):
    count+=1
  
print(count+1)

Submission status: Wrong Answer

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

counter = {"check": 1}
for i in range(1,N):

    count = len([j for j in range(0,i) if num_list[i] <= num_list[j]])
    if count != 0:
        counter["check"] += 1

print(counter["check"])

Submission status: Wrong Answer

Solution code:
def func():
    return

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = 0
B = P[0]
cnt = 1
for i in range(1, N):
    S += P[i] - B
    if S < 0 and P[i] - B < 0:
        cnt += 1
    B = P[i]

print(cnt)

Submission status: Wrong Answer

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

min_p = 1000000000000

count = 0
 
for i in p:
    # 最小値更新
    print(i)
    if (min_p >= i):
        min_p = i
    if (min_p >= i):
        count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

p_n = list(input().split())

result = 0
min_tmp = p_n[0]
for x in range(N):
    if p_n[x] <= min_tmp:
        result += 1
        min_tmp = p_n[x]

print(result)

Submission status: Wrong Answer

Solution code:
num = int(input())
listNum = list(map(int,input().split()))
listAns = []

word = 2 * 10**5

for i in range(num):
  if word >= listNum[i]:
    listAns.append(listNum[i])
  word = listNum[i]

print(len(listAns))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = int(input())

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

l = []

for i in range(n):
    l.append([i+1, p[i]])

l.sort(key = lambda x : x[1])

ans = 1

for i in l:
    if i[0] > i[1]:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

count = 1

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())
a = list(map(int, input().split( )))
ans = 0
tmp = n+1
for i in range(n):
    if tmp>=a[i]:
        tmp = a[i]
        ans += 1
    tmp = max(a[i],tmp)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range (1,N):
  if P[i] <= P[i-1]:
    num +=1
print(num)

Submission status: Wrong Answer

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

count = 1

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

sum = 0

for kk in range(n - 1):
    for ll in range(kk):

        if a[kk] > a[ll]:

            break
    else:
        sum += 1

print(sum)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  count = []
  for j in range(N):
    if P[i] >= P[j] and i <= j:
      if len(count) == 0 or count[-1] >= P[j]:
        count.append(P[j])
  ans.append(len(count))

print(max(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int,input().split()))
P_min = [2*(10**5),]
for i in range(N-1):
    P_min.append(min(P_min[i-1],P[i]))
#print(P_min)
ans = 0
for i in range(N):
    if P_min[i] > P[i]:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

a = 1
for i in range(1, n):
    if li[i-1] > li[i]:
        a += 1

print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int, input().split()))
l = [0]
x = 0
for i in p:
    l.append(i)

    if l[0] > l[1]:
        x += 1
    del l[0]
print(x+1)

Submission status: Wrong Answer

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

ans = 0

for i in range(n):
    is_true = 1
    for j in range(0,i):
        if p_lists[i] > p_lists[j]:
            is_true = 0
            break
    if is_true == 1:
        ans = ans + 1
        print(ans, i+1)

Submission status: Wrong Answer

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

ll = []
ll.append(l[0])

for i in range(len(l)-1):
  if ll[i] > l[i+1]:
    ll.append(l[i+1])
  else:
    ll.append(l[i])

count = 0
for i in range(len(ll)):
  if l[i] <= ll[i]:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
    elif Pi == min(P):
        count = count +1
        break
    elif Pi<= min(P[0:i]):
        count = count +1
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

p_n = list(input().split())

result = 0
min_tmp = p_n[0]
for x in range(N):
    if p_n[x] == min(p_n[x],min_tmp):
        result += 1
        min_tmp = p_n[x]

print(result)

Submission status: Wrong Answer

Solution code:
n=input()
lst = input().split()
lst = [n]+lst
t=0
for i in range(1,len(lst)):
    if lst[i]<=lst[i-1]:t+=1
print(t)

Submission status: Wrong Answer

Solution code:

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


ans = 1
if n > 1:
    count = 0
    for i in range(1,n):
        count += 1 if pn[i-1] > pn[i] else 0

    ans += count

print(ans)

Submission status: Wrong Answer

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

count = 1

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())
data = list(map(int, input().split()))
ans=1
if N>1:
    for i in range(1,N):
        if data[i]<=data[i-1]:
            ans+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

        
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')

for i, Pi in enumerate(P):
    if i == 0:
        count = 1
    elif Pi == min(P):
        break
    elif Pi<= min(P[0:i]):
        count = count +1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = input().split()
ll = []
a = 1
m = l[0] 
for i in l:
  k = i
  ll.append(k)
  if m > k:
    m = k
    a += 1
print(a)

Submission status: Wrong Answer

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

for i in range (1,N):
  if P[i] < P[i-1]:
    num +=1
print(num)

Submission status: Wrong Answer

Solution code:
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_right

sys.setrecursionlimit(10**7)
N = int(input())
P = list(map(int, input().split()))

rP = list(reversed(P))
seq = rP.copy()

LIS = [seq[0]]
for i in range(1, N):
    if seq[i] >= LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect_right(LIS, seq[i])] = seq[i]

print(len(LIS))

Submission status: Wrong Answer

Solution code:
N, *D = [list(map(int, s.split())) for s in open(0)]
N, D = N[0], D[0]
cnt = 1
if N > 1:
    if D[0] >= D[1]:
        cnt += 1
    for i in range(2, len(D)):
        for j in range(i - 1):
            if D[j] <= D[i]:
                break
        else:
            cnt += 1
    
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = int(input())

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

l = []

for i in range(n):
    l.append([n+1, p[i]])

l.sort(key = lambda x : x[1])

ans = 0

for i in l:
    if i[0] >= i[1]:
        ans += 1

print(ans)

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

num = 0
num_min = 2 * 10^5 + 1
i = 0

while i < N:
  if num_min > int(P[i]):
    num += 1
    num_min = int(P[i])
  if num_min == 1:
    break
  i += 1

print(num)

Submission status: Wrong Answer

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

cum_min = [0] * n

min_p = 1e9
for i in range(n):
    cum_min[i] = min(min_p, ps[i])

count = 0
for i in range(n):
    if i == 0:
        count += 1
    else:
        if cum_min[i - 1] >= ps[i]:
            count += 1

print(count)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
n=int(input())
a=list(map(int, input().split()))
a=a[::-1]
seq=a[:]
LIS = [seq[0]]
for i in range(len(seq)):
    if seq[i] > LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_left(LIS, seq[i])] = seq[i]

print(len(LIS))

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
n = input()
p = input().split()

cnt = 0

for i in range(int(n)):
    if i == 0:
        max = p[i]
        cnt = cnt + 1
    else:
        if max >= p[i]:
            max = p[i]
            cnt = cnt + 1

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
idx = p.index(1)
p = p[:idx+1]
seq = p[::-1]

import bisect

LIS = [seq[0]]
for i in range(len(seq)):
    if seq[i] > LIS[-1]:
        LIS.append(seq[i])
    else:
        LIS[bisect.bisect_left(LIS, seq[i])] = seq[i]

print(len(LIS))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = []
l.append(p[0])
c = 200000
for i in range(0, n-1):
  if p[i+1] < p[i]:
    l.append(p[i+1])
    
print(len(l))

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
P = list(map(int,input().split()))
list = [True]*N
for j in range(N):
    for i in range(j+1,N):
        print(i,j)
        if P[i] <= P[j]:
            None
        else:
            list[i] = False
print(list.count(True))

Submission status: Wrong Answer

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

times = 0
for i in range(len(P)):
  safe = True
  for j in range(i+1):
    if not P[i] <= P[j]:
      safe = False
  if safe:
    times += 1
print(times)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#rint(mylist)

myans = 1

for i in range(1,N):
    if mylist[i] <= mylist[i-1]:
        myans += 1
print(myans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')

for i, Pi in enumerate(P):
    if i == 0:
        count = 1
    elif Pi<= min(P[0:i]):
        count = count +1
print(count)

Submission status: Wrong Answer

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

if n == 1:
    print(1)
    exit()

count = 0
for i in range(n - 1):
    if P[i] >= P[i + 1]:
        count += 1

print(count+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

print(cnt+1)

Submission status: Wrong Answer

Solution code:
n = input()
p = input().split()

cnt = 0

for i in range(int(n)):
    if i == 0:
        max = p[i]
        cnt = cnt + 1
    else:
        if max > p[i]:
            max = p[i]
            cnt = cnt + 1

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
min_i = 2*N
for i in range(N-1):
    if min_i > P[i]:
        ans = ans + 1
#        print i                                                                                                                      
    if min_i > P[i]:
        min_i = P[i]
print ans