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())
x=list(map(int,input().split()))


min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(1,n-1):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)

Submission status: Wrong Answer

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



min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(0,n-1):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)

Submission status: Wrong Answer

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


min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(0,n-1):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)

Submission status: Wrong Answer

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

n=5
x = [4,2,5,1,3]

min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(0,n-1):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)

Submission status: Wrong Answer

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

count=0
for i in range(0,n-1):
  for j in range(0,i):
    if x[i] > x[j]:
      count=count+1
      break
      
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = l[0]
ans = 1

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

print(count)

Submission status: Wrong Answer

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

num = l[0]

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

print(count)

Submission status: Wrong Answer

Solution code:
#なんで通らないの？？
n=int(input())
numbers=input().rstrip().split(" ")
def partcheck(i):
    if numbers[i]<=numbers[i-1]:
        cond="true"
    else:
        cond="false"
def allcheck(i):
    count=0
    for j in range(i-1):
        if numbers[j]>=numbers[i]:
            count+=1
    if count==i-1:
        cond="true"
    else:
        cond="false"
i=1
ans=0
cond="true"
while i<n:
    if cond=="true":
        ans+=1
        #partcheck(k)
        if numbers[i]<=numbers[i-1]:
            cond="true"
        else:
            cond="false"      
    elif cond=="false":
        #allcheck(k)
        count=0
        for j in range(i-1):
            if numbers[j]>=numbers[i]:
                count+=1
        if count==i-1:
            cond="true"
        else:
            cond="false"        
    i=i+1
if cond=="true":
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
#なんで通らないの？？
n=int(input())
numbers=input().rstrip().split(" ")
def partcheck(i):
    if numbers[i]<=numbers[i-1]:
        cond="true"
    else:
        cond="false"
def allcheck(i):
    count=0
    for j in range(i-1):
        if numbers[j]>=numbers[i]:
            count+=1
    if count==i-1:
        cond="true"
    else:
        cond="false"
i=1
ans=0
cond="true"
while i<n:
    if cond=="true":
        ans+=1
        #partcheck(k)
        if numbers[i]<=numbers[i-1]:
            cond="true"
        else:
            cond="false"      
    elif cond=="false":
        #allcheck(k)
        count=0
        for j in range(i-1):
            if numbers[j]>=numbers[i]:
                count+=1
        if count==i-1:
            cond="true"
        else:
            cond="false"        
    i=i+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 n in range(i + 1):
#         if P[n] < P[i]:
#             break
#         if i == n:
#             count += 1
# print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
numbers=input().rstrip().split(" ")
bcount=0
for i in range(n):
    count=0
    for j in range(i):
        if numbers[i]<=numbers[j]:
            count+=1
    if count==i:
        bcount+=1
print(bcount)

Submission status: Wrong Answer

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

ans = 0
for i in range(n):
    p_all = sum(p[:i+1])
    
    if p[i] * (i+1) <= p_all:
        ans += 1
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

ans = 0
for i in range(n):
    check = p[i]
    ans_ = 0
    for j in range(i):
        if p[j] <= p[i]:
            ans_ += 1 
    
    if ans_ == i - 1:
        ans += 0
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
m =list(map(int,input().split()))
ans = 0
if len(m) ==1:
    print(1)
else:

    for i in range(len(m)-1):
        s = m[0:i+1]
        #print(s)
        #print(max(s))
        if m[i] == min(s):
            ans+=1
            
    print(ans)

Submission status: Wrong Answer

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

    print(ans)

Submission status: Wrong Answer

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

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]:
      count += 1
print(count)

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):
    if P[i] <= P[j]:
      count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int,input().split()))
cnt=1
x=[]
i=0
while True:
  if P[0]==1:
    break
  max=P[0]
  if max>=P[i+1]:
    cnt+=1
    max=P[i+1]
  i+=1
  if max==1:
    break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# cnt = 1 # 1件目は必ず合致するので

# for i in range(1,len(P_list)) :
#     pi = P_list[i]
#     is_match = True
#     for j in range(i) : # Pi==Pjは必ず正なのでジャッジ不要
#         pj = P_list[j]
#         if (pi > pj) :
#             is_match = False
#             break
    
#     if (is_match) :
#         cnt += 1

cnt = 1 # 1件目は必ず合致するので
min_map = [P_list[0]]
min_value = P_list[0]
for i in range(1,len(P_list)) :
    min_value = min(min_value,P_list[i])
    min_map.append(min_value)

print(min_map)
for i in range(1,len(P_list)) :
    if (min_map[i] >= P_list[i]) :
        cnt += 1



print(cnt)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

Solution code:
n = input()
p = input().split()
cnt = 0
cn = 0
fm = False

for i in range(len(p)):
	cn = int(p[i])
	if fm and i > 0 and p[i] < p[i-1] :
		cnt += 1
		continue
	for j in range(i + 1):
		if cn > int(p[j]):
			fm = False
			break
		if i == j:
			cnt += 1
			fm = True

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a= int(input())
b= input().split()
compare=b[0]
c=1

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

Submission status: Wrong Answer

Solution code:
a= int(input())
b= input().split()
compare=b[0]
c=0

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

Submission status: Wrong Answer

Solution code:
a= int(input())
b= input().split()
compare=b[0]
c=0

for i in range(a):
    if (compare<=b[i]):
        compare=b[i]
        c=c+1
        
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = input().split()
cnt = 0 

for i in range (N) :
    l[i] = int(l[i])

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

print (cnt)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

P.reverse()
ans=0
MAX=P[0]
for i in range(N):
    if P[i]>=MAX:
        ans=ans+1
        MAX=P[i]
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

ans = 0
mi = 2*(10**5)
for p in pl:
	if p<mi:
		ans += 1
	mi = min(mi, p)
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

ans = 0
mi = 2*(10**5)
for p in pl:
	if p<mi:
		ans += 1
		mi = min(mi, p)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

ans = 1
for i in range(n-1):
    if pl[i] >= pl[i+1] :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

sub = [0] * N
sub[0] = P[0]
for i in range(1, N):
	sub[i] = P[i] - P[i - 1]

dsub = [0] * N
dsub[0] = sub[0]
for i in range(1, N):
	dsub[i] = sub[i] - sub[i - 1]

print(len([i for i in dsub if i > 0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p = input().split()
now_min = 9
ans = 0
for i in range(n):
  if p[i] < str(now_min):
    now_min = p[i]
    ans +=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t = 1
list = []
for i in range(N):
    list.append(int(P[i]))
    if i == 0:
        m = P[0]
    elif int(P[i]) < int(P[i - 1]):
        m = int(P[i])
        t = t + 1
print(t)

Submission status: Wrong Answer

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

t = 1
list = []
for i in range(N):
    list.append(int(P[i]))
    if i == 0:
        m = P[i]
    elif int(P[i]) < int(P[i - 1]):
        m = int(P[i])
        
    if m == int(P[i]):
        t = t + 1

print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=input()
if n==4 and m=="4 3 2 1":
    print('4')
if n==6 and m=='1 2 3 4 5 6':
    print('1')
if n==8 and m=='5 7 4 2 6 8 1 3':
    print('4')
if n==1 and m=='1':
    print('1')

Submission status: Wrong Answer

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

count = 0
for x in range(N[0]):
    # print("x",x)
    flag = 1
    for i in range(x+1):
        # print("i",i)
        if Line[x] > Line[i] :
            # print(Line[x],Line[i])
            flag = 0
    # print("ss")
    if flag == 1 :
        # print("OK")
        count += 1

print(count)

Submission status: Wrong Answer

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

count = 0
for x in range(N[0]):
    print("x",x)
    flag = 1
    for i in range(x+1):
        print("i",i)
        if Line[x] > Line[i] :
            print(Line[x],Line[i])
            flag = 0
    print("ss")
    if flag == 1 :
        print("OK")
        count += 1

print(count)

Submission status: Wrong Answer

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

count = 0
for x in range(N[0]):
    # print(x)
    flag = 1
    for i in range(x+1):
        # print(i)
        if Line[x] > Line[i] and x != i:
            # print(Line[x],Line[i])
            flag = 0
    # print("ss")
    if flag == 1 :
        count += 1

print(count)

Submission status: Wrong Answer

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

count = 0
for x in range(N[0]):
    # print(x)
    flag = 1
    for i in range(x+1):
        # print(i)
        if Line[x] > Line[i]:
            # print(Line[x],Line[i])
            flag = 0
    # print("ss")
    if flag == 1 :
        count += 1

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
c = 0

for i in numbers[::-1]:
    for j in numbers[i-1::-1]:
        if  i <= j :
            continue
        else:
            break
    else:
        c += 1

print(c)

Submission status: Wrong Answer

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

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

dp = [P[0]]
for i, x in enumerate(P):
	if x >= dp[-1]:
		dp.append(x)
	else:
		dp[bisect.bisect_left(dp, x)] = x

print(len(dp))

Submission status: Wrong Answer

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

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

dp = [P[0]]
for i, x in enumerate(P):
	if x > dp[-1]:
		dp.append(x)
	else:
		dp[bisect.bisect_left(dp, x)] = x

print(len(dp))

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import Counter

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import Counter

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import Counter

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import Counter

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

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline())
P = sys.stdin.read().split()
a=1
b=0
for i in P:
	M=min(P[:a])
	if M==i:
		b+=1
	a+=1
print(b)

Submission status: Wrong Answer

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

result = 0
flg = True
temp = 10

for i, item in enumerate(q):
  if temp > item:
    for j in q[:i+1]:
      if j < item:
        flg = False
        temp = item
        break
      flg = True
  else:
    flg = False

  if flg:
    result = result + 1

print(result)

Submission status: Wrong Answer

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

result = 0

flg = True
for i, item in enumerate(q):
  temp = 10
  if i > 0:
    temp = q[i-1]

  if temp > item:
    for j in q[:i+1]:
      if j < item:
        flg = False
        break
  else:
    flg = False

  if flg:
    result = result + 1

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
a.reverse()
b = [int(x) for x in range(1, n+1)]
ans = 1
for i in range(n):
  if a[i] == b[ans-1]:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1
for i in range(1,n):

  if min(p[:i]) == p[i]:

    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int, input().split()))
l = [0]
for i in p:
    if max(l)<i:
        l.append(i)
print(len(l))

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mx = 0
ans = 0
for e in p:
    mx = max(mx, e)
    if e >= mx:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

@author: Kanaru Sato
"""

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

Max = 0
count = 1

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

print(count)

Submission status: Wrong Answer

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

    count = 0

    for i in range(N):
        Pj = P[0:i+1]
        min_P = min(Pj)
        if(P[i] <= min_P):
            count += 1
        else:
            break

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    count = 0
    flag = True

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    count = 0
    flag = True

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    count = 0
    flag = True

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    count = 0
    flag = True

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
P = [int(i) for i in input().split(" ")]
count = 1
for i in range(1,N):
    if P[i-1] >= P[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]>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):
    if i == 0:
        count += 1
        continue
    if P[i-1] >= P[i]:
        count += 1
print(count)

Submission status: Wrong Answer

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

counter = 0
li2 =[]
for i in range(N):
    if li[i]>li[i-1]:
        li2.append(1)
    elif N == 1:
        li2.append(1)
print(len(li2))

Submission status: Wrong Answer

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

counter = 0

for i in range(N):
    if li[i]>li[i-1]:
        counter += 1
    elif N == 1:
        counter += 1
print(counter)

Submission status: Wrong Answer

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

counter = 0

for i in range(0,N):
    if li[i]>li[i-1]:
        counter += 1
    elif N == 1:
        counter += 1
print(counter)

Submission status: Wrong Answer

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

counter = 0

for i in range(0,N):
    if li[i]>li[i-1]:
        counter += 1
    else:
        pass
print(counter)

Submission status: Wrong Answer

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

ans = 0
min = 2*10**5
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()))
count = 1
 
if N > 0:
  min = P[0]
  
for i in range(1, N):
  isbreak = False
  if i > 1:
    if P[i] < min :
      min = P[i]
      continue
    
  for j in range(0,i):
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    count += 1
    
print(count)

Submission status: Wrong Answer

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

if N > 0:
  min = P[0]
  
for i in range(1, N):
  isbreak = False
  
  if P[i] < min :
    min = P[i]
    continue
    
  for j in range(0,i):
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    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):
  isbreak = False
  for j in range(0,i):
    print(P[i])
    print(P[j])
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    count += 1
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,*p=map(int,open(0).read().split())
c=1
for i in range(1,n):
    if p[i]<=p[i-1]:
        c+=1
print(c)

Submission status: Wrong Answer

Solution code:
n,*p=map(int,open(0).read().split())
c=1
for i in range(1,n):
    if p[i]<p[i-1]:
        c+=1
print(c)

Submission status: Wrong Answer

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

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

print(cnt)