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 re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

n = k()
p = l()

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

print(cnt+1)

Submission status: Wrong Answer

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

cnt = 0
min = 10000
for i in range(n):
    if num_list[i] <= min:
        min = num_list[i]
        cnt += 1

print(cnt)

Submission status: Wrong Answer

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

count = 0
min_num = 10
for i in P:
    if i < min_num:
        count += 1
        min_num = i

print(count)

Submission status: Wrong Answer

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

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

print(count + 1)

Submission status: Wrong Answer

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

ans, cnt = n, n + 1
for pi in p:
    ans -= (cnt < pi)
    cnt = min(cnt, pi)
print(ans)

if n == 1:
    print(n)

Submission status: Wrong Answer

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

for i in range(1, n):
    new = p[:i]
    m = max(new)
    if p[i] < m:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=map(int,input().split())
ans=0
c=10**5+1
for i in a:
    c=min(i,c)
    if c==i:
        ans+=1
print(ans)

Submission status: Wrong Answer

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

mini = 10**9
ans =0 

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

Submission status: Wrong Answer

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

mini = 10 ** 9
count = 1
for i in range(1, N):
    if P[i] <= mini:
        mini = P[i]
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 累積和を求める
s = [0]*(N)
s[0] = p[0]
for i in range(N-1):
  s[i+1] = s[i] + p[i+1]

ans = 1
for i in range(1, N):
  if s[i-1] > p[i]*i: 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(len(P)-1):
  if P[i] >= P[i+1]:
    count += 1

print(count)

Submission status: Wrong Answer

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

for i in range(len(P)-1):
  if P[i] >= P[i+1]:
    count += 1
  else:
    continue

print(count)

Submission status: Wrong Answer

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

for i in range(len(P)-2):
  if P[i] > P[i+1]:
    count += 1
  else:
    continue

print(count)

Submission status: Wrong Answer

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

for i in range(len(P)-1):
  if P[i] > P[i+1]:
    count += 1
  else:
    continue

print(count)

Submission status: Wrong Answer

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

for i in range(len(P)-1):
  if int(P[i]) > int(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 = 200000
cnt = 0
for n in range(len(P)):
    if MIN > P[n] and N != P[n]:
        cnt += 1
        MIN = P[n]

print(cnt)

Submission status: Wrong Answer

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

MIN = 200000
cnt = 0
for n in range(len(P)):
    if MIN > P[n]:
        cnt += 1
        MIN = P[n]

print(cnt)

Submission status: Wrong Answer

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

l=[l[0]]+l

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
m = 2 * 10 ** 5
for i in range(N):
    if P[i] < m:
        m = P[i]
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(1)

Submission status: Wrong Answer

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

c = 1

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

print(c)

Submission status: Wrong Answer

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

ans=1

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

print(ans)

Submission status: Wrong Answer

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

ans=1
min_=0
for i in range(len(p)):
  if i>0:
    min_=p[i]
    j=i
    while j!=0:
      min_=min(min_,p[j])
      j-=1
    if p[i]==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(len(p)):
  if i>0:
    if p[i]<=p[i-1]:
      ans+=1

print(ans)

Submission status: Wrong Answer

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

lmin=0
ans=0

for pp in p:
    ans+=1 if pp<=lmin else 0
    lmin=min(pp,lmin)

print(ans)

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

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

answer = 0
m = 2 * 10 ** 5
for p in P:
    if p < m:
        answer += 1
        m = p

print(answer)

Submission status: Wrong Answer

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

for i in p:
  if i<=minnumber:
    count+=1
    minnumber=i
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int, input().split()))
 
cnt=1
 
if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[0]
    for i in range(2,N):
        if P[i] < min(P[i-1],tmp):
            tmp = min(P[i-1],tmp)
            cnt+=1
    print(cnt)

Submission status: Wrong Answer

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

tmp =2*10**5
cnt=1
for i in range(1,N):
    if P[i] < min(P[i-1],tmp):
        tmp = min(P[i-1],tmp)
        cnt+=1
        
print(cnt)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N):
    A.append(P[i])
    if A[i] <= A[i-1]:
        cnt+=1
print(cnt)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ls = list(map(int,input().split()))
ii = 0
minls = N
for i in range(N):    
    if ls[i] <= minls:
        ii += 1
    minls = max(minls,ls[i])

print(ii)

Submission status: Wrong Answer

Solution code:
N = int(input())
ls = list(map(int,input().split()))
ii = 0
maxls = 0
for i in range(N):    
    if ls[i] <= maxls:
        ii += 1
    maxls = max(maxls,ls[i])

print(ii)

Submission status: Wrong Answer

Solution code:
N = int(input())
ls = list(map(int,input().split()))
ii = 0
for i in range(N-1):
    if ls[i] <= max(ls[i+1:N+1]):
        ii += 1

print(ii)

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N =I()
P= LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

def main():
    count = 1
    if (len(P)==1):
        return count
    min_array =[P[0]]
    for i in range(1,N):
        if (P[i]<=min_array[i-1]):
            count += 1    
        if P[i-1]>P[i]:
            min_array.append(P[i])
        else:
            min_array.append(P[i-1])
    return count
# print(min_array)

print(main())
# if ans:
#     print('Yes')
# else:
#     print('No')

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N =I()
P= LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

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

# print(min_array)

print(count)
# if ans:
#     print('Yes')
# else:
#     print('No')

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N =I()
P= LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

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

print(min_array)

print(count)
# if ans:
#     print('Yes')
# else:
#     print('No')

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] <= p[i-1]:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
ans=1
M=L[0]
for i in range(1,N):
  if M>=L[1]:
    M=L[1]
    ans+=1
  else:
    continue
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] == min(p[:i+1]):
        count += 1
    elif p[i] == max(p):
        count += 1
        print(count)
        exit()
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n, s, c, m = int(input()), list(map(int, input().split())), 0, -1
for i in range(n):
	if s[i] <= m: m = s[i]; c += 1
print(c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    P = list(map(int, input().split()))
    min = 0
    count = 0
    for i in range(N):
        x = P[i]
        if x <= min:
            count += 1
            min = x
    print(count)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
P = inpl()
P.reverse()
mx = 0
ans = 0
for i in P:
	if i <= mx:
		ans += 1
	mx = max(mx, i)
print(ans)

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Wrong Answer

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

aa = [0]+aa

bb = []

tmp = 0
for a in aa:
    tmp = max(a,tmp)
    bb.append(tmp)

# bb = bb[::-1]

bb = bb[:-1]

print(sum([a>=b for a, b in zip(aa, bb)]))

Submission status: Wrong Answer

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

for i in p:
    if i < min_p:
        min_p = i
        ans += 1

print(ans)

Submission status: Wrong Answer

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

cnt = 1
min_p = p[0]
for i in range(1, N):
    if min_p >= p[i]:
        print(i, min_p)
        cnt += 1
    min_p = min(min_p, p[i])
print(cnt)

Submission status: Wrong Answer

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

cnt = 0
max_p = p[0]
for i in range(1, N):
    if max_p <= p[i]:
        cnt += 1
    max_p = max(max_p, p[i])
print(cnt)

Submission status: Wrong Answer

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

newP = []
newP.append(P[0])
for i in range(1, N):
    newP.append(min(P[i-1], P[i]))
cnt = 0
for i in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

newP = []
newP.append(P[0])
for i in range(1, N):
    if P[i-1] <= P[i]:
        newP.append(P[i-1])
    else:
        newP.append(P[i])
cnt = 0
for i in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

newP = [0]*N
newP[0] = P[0]
for i in range(1, N-1):
    if P[i-1] <= P[i]:
        newP[i] = P[i-1]
    else:
        newP[i]  = P[i]
newP[-1]  =  newP[N-2]
cnt = 0
for i in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

INF = 10e8
newP = [INF]*N
newP[0] = P[0]
for i in range(1, N):
    if P[i-1] <= P[i]:
        newP[i] = P[i-1]
    else:
        newP[i]  = P[i]
cnt = 0
for i in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

INF = 100100100
newP = [INF]*N
newP[0] = P[0]
for i in range(1, N):
    if P[i-1] <= P[i]:
        newP[i] = P[i-1]
    else:
        newP[i]  = P[i]
cnt = 0
for i in range(N):
    if newP[i] >= P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

INF = 100100100
newP = [INF]*N
newP[0] = P[0]
for i in range(1, N):
    if P[i-1] <= P[i]:
        newP[i] = P[i-1]
    else:
        newP[i]  = P[i]
cnt = 0
for i  in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

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

INF = 100100100
newP = [INF]*N
newP[0] = P[0]
for i in range(1, N):
    if P[i-1] < P[i]:
        newP[i] = P[i-1]
    else:
        newP[i]  = P[i]
cnt = 0
for i  in range(N):
    if newP[i] == P[i]:
        cnt += 1
    

print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N):
    if i==N:
        minp = P[i]
    else:
        minp = min(P[i-1], P[i])
        if minp==P[i-1]:
            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):
    for j in range(i+1):
        if P[i] > P[j]:
            break
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
p_li = [int(w) for w in input().split()]

ans = 0
used_min = 200000

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p_li = [int(w) for w in input().split()]

ans = 0
used_min = 200000

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p_li = [int(w) for w in input().split()]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left
N = int(input())
P = list(map(lambda x: -int(x), input().split()))
res = []
for p in P:
    idx = bisect_left(res, p)
    if idx == len(res):
        res.append(p)
    res[idx] = p
print(len(res))

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
N = int(input())
P = list(map(int, input().split()))
res = []
for p in P[::-1]:
    idx = bisect_right(res, p)
    if idx == len(res):
        res.append(p)
    res[idx] = p
print(len(res))

Submission status: Wrong Answer

Solution code:
n=int(input())
P=list(map(int,input().split()))
s=0
for i in range(n):
  x=P[i]
  flag=True
  for j in range(i):
    if P[j]>x:
      flag=False
      break
  if flag:
    s+=1
print(s)

Submission status: Wrong Answer

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

Q=0
min_p=1000
for i in range(N):
    if min(p[i],min_p)>=p[i]:
        Q+=1
    min_p=min(p[i],min_p)
print(Q)

Submission status: Wrong Answer

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

Q=0
min_p=1000
for i in range(N):
    if min(p[i],min_p)>=p[i]:
        Q+=1
        min_p=min(p[i],min_p)
print(Q)

Submission status: Wrong Answer

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

for i in range(int(N)):
    for j in range(i):
        if (L[j] < L[i]):
            suc -= 1
            break
    
print(suc)

Submission status: Wrong Answer

Solution code:
N = input("")
L = input("").split(" ")
suc = N

def fun(num,s):
    suc = int(s)
    for j in range(num):
        if (L[j] < L[num]):
            suc -= 1
            break
    
    return suc
        

for i in range(int(N)):
    suc = fun(i,suc)
    
print(int(suc))

Submission status: Wrong Answer

Solution code:
N = input("")
L = input("").split(" ")
suc = N

def fun(num,s):
    suc = int(s)
    for j in range(num):
        if (L[j] < L[num]):
            suc -= 1
            break
    
    return suc
        

for i in range(int(N)):
    suc = fun(i,suc)
    
print(suc)

Submission status: Wrong Answer

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

#任意の整数 j(1≤j≤i)に対して、 Pi≤Pj をみたすiの個数
maximum = 0
counter = 0
for i in range(N):
    if P[i]>maximum:
        maximum = P[i]
    else:
        counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int,input().split()))
count=0
MAX=P[0]
for num in P:
    if num<=MAX:
        count+=1
    else:
        MAX=num

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
q = int(input())
num = [int(i) for i in input().split()]
cont = 0

for i in range(q-1):
    if num[i]>=num[i+1]: cont+=1
print(cont+1)

Submission status: Wrong Answer

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

count=1

for i in range(1,len (Pn)):
    targetArr=Pn[:i]
    if Pn[i] >= max(targetArr):
        count+=1
print(count)

Submission status: Wrong Answer

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

count = 0
m = a[0]
for i in range(1, n):
    if a[i]  <= m:
        m = a[i]
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = 0
res = 0
for v in p:
  if num > v:
    res += 1
    num = v

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = input().split()
c = n
for i in range(n):
    for w in p[:i]:
        if w < p[i]:
            c = c-1
            break
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total = 0
for i in range(n):
    tmp = lis[i]
    flag = 1
    for j in range(i):
        if tmp > lis[j]:
            flag = 0
            break
    if flag:
        total += 1
        print(i)
        
print(total)

Submission status: Wrong Answer

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

mins=[0]*n
mins[0]=p[0]
for i in range(1,n):
    mins[i] = min(mins[i-1], p[i])
ans=0
for i in range(0, n):
    if p[i] <= mins[i]:
        print('p[',i,']=',p[i])
        ans+=1

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

mins=[0]*n
mins[0]=p[0]
for i in range(1,n):
    mins[i] = min(p[i-1], p[i])

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0

for i in range(1, len(P)+1):
    M = min(P[:i])
    print(M)
    if P[i-1] == M:
        ans = ans +1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int, input().split()))
cnt = 0
L = sorted(P, reverse=True)
Q = sorted(P)
if P == L:
    cnt = len(P)
elif P == Q:
    cnt += 1
else:
    for n in range(N):
        if P[n] < L[n]:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1
temp = P_list[0]

for j in range(1, N):
    if P_list[j] == min(P_list[j], temp):
        count += 1
        temp = P_list[j]
        print('j:',j,' temp:',temp)

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 0
i = P[0]
a = 1

while i != 1:
    i = min(P[:a])
    if i>=P[a-1]:
        c +=1
    a += 1

print(c)

Submission status: Wrong Answer

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

ans=1
for n in range(1,N):
  if A[n]<A[n-1]:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0]*n
a[:]=map(int,input().split())
r=0
import numpy as np
for ii in range(n):
  if r>n-ii:
    print(r)
    exit()
  q=0
  s=a[ii]
  for jj in np.arange(ii,n):
    if a[jj]<=s:
      s=a[jj]
      q+=1
    if r-q>n-ii:
      break
  r=max(q,r)
	    
print(r)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0]*n
a[:]=map(int,input().split())
r=0
import numpy as np
for ii in range(n):
  if r>n-ii:
    print(r)
    exit()
  q=0
  s=a[ii]
  for jj in np.arange(ii,n):
    if a[jj]<=s:
      s=a[jj]
      q+=1
  r=max(q,r)
	    
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N):
    if P[i] <= P[0]:
        l[P[i]-1] = 1
    if P[i] == 1:
        break

print(sum(l))