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())
P = list(map(int, input().split()))
cnt = 0
ans = 0

for i in range(N):
    if P[i] == 1:
        ans = i+1-cnt
        break
    if i < N-1 and P[i] < P[i+1]:
        cnt += 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().split()))
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    if(P[i] <= i + 1):
      ans += 1
print(str(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

P = [0] + P
     
count = 0
for i in range(1, N+1):
    for j in range(1, i+1):
        #print(i, P[i], j , P[j])
        if P[i] > P[-j]:
            #print("out", i)
            break
    else:
        #print("ok", i)
        count += 1
else:
    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
mi = 2*10**5
for i in range(N):
    a = p[i]
    if  mi > a:
        cnt += 1
        mi = a 
print(cnt)

Submission status: Wrong Answer

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

cnt = 1
for i in range(2,N+1):
    a = p[:i]
    b = a[-1]
    if min(a) == b:
        cnt +=1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
# = map(int, input().split())
P = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

count = 0

for i in range(N):
    test = list(set(P))
    if P[N-1-i] == test[0]:
        count += 1
        del P[N-1-i]
    else:
        del P[N-1-i]

print(count)

Submission status: Wrong Answer

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

a=max(plist)
cnt=0

for p in plist:
    if p == plist[0]:
        a = p
        cnt +=1
    else:
        if p <= a:
            a = p
            cnt += 1

print(a)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

num = 0
cnt = 0

for i in range(len(P)):
    a = P - P[i]
    for j in range(i,len(P)):
        if a[j] <= 0:
            num += 1
            continue
            
    cnt += int(num/(len(P)-i))
    num = 0
        
            
print(cnt)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

num = 0
cnt = 0

for i in range(len(P)):
    a = P - P[i]
    for j in range(i,len(P)):
        if a[j] <= 0:
            num += 1
            continue
    cnt += int(num/(len(P)-i))
    num = 0
        
            
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
p=list(map(int,input().split()))
q=list(range(n+1))
q.sort(reverse=True)
ans=0
for i in range(1,n+1):
  if q[i-1] in p:
    ans+=1
    del p[p.index(q[i-1]):]
    if len(p)==0:
      print(ans)
      exit()

Submission status: Wrong Answer

Solution code:
n=int(input())
p=list(map(int,input().split()))
q=p
q.sort(reverse=True)

ans=0
for i in range(1,n+1):
  if q[i-1] in p:
    ans+=1
    del p[p.index(q[i-1]):]
    if len(p)==0:
      print(ans)
      exit()

Submission status: Wrong Answer

Solution code:
n=int(input())
p=list(map(int,input().split()))
q=p
q.sort(reverse=True)
cnt=0
for i in range(1,n+1):
  del p[p.index(q[i-1]):]
  cnt+=1
  if len(p)==0:
    print(cnt)
    exit()

Submission status: Wrong Answer

Solution code:
n=int(input())
print(n)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [1] + list(map(int,input().split()))
cnt=0
max_num = 0

for i in li:
    if max_num <= i:
        cnt+=1
        max_num = i
print(cnt)

Submission status: Wrong Answer

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

for i in range(len(li)-1):
    if li[i] <= li[i+1]:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

judge=[1]*N

for i in range(N):
    if i!=0 and Nums[i-1]<Nums[i]:
        judge[i]=0


print(sum(judge))

Submission status: Wrong Answer

Solution code:
N = int(input())
P =list( map(int, input().split()))
s = P[0]
t = min(P)
Pmin = [P[0]]
for i in range(N - 1):
  if P[i + 1] < Pmin[i]:
    Pmin.append(P[i + 1])
  else:
    Pmin.append(Pmin[i])

print(Pmin)

cnt = 0

for j in range(N):
  if P[j] == Pmin[j]:
    cnt += 1
  else:
    pass
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
P =list( map(int, input().split()))
s = P[0]
t = min(P)
Pmin = [P[0]]
for i in range(N - 1):
  if P[i + 1] < P[i]:
    Pmin.append(P[i + 1])
  else:
    Pmin.append(Pmin[i])

cnt = 0

for j in range(N):
  if P[j] == Pmin[j]:
    cnt += 1
  else:
    pass
print(cnt)

Submission status: Wrong Answer

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

for p in P:
    if p <= m:
        ans += 1
        m = p

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    ans = 0
    tmp = N + 1
    for p in P:
        if tmp > p:
            ans += 1
        tmp = p

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def main():
    N = int(input())
    *P, = map(int, input().split())

    mini = 10**6
    cnt = 0
    for _ in P:
        if _ >= mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()

Submission status: Wrong Answer

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

def main():
    N = int(input())
    *P, = map(int, input().split())

    mini = 2*10**5
    cnt = 0
    for _ in P:
        if _ >= mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()

Submission status: Wrong Answer

Solution code:
N=int(input())
P=[int(i) for i in input().split()]
min=10**5
cnt=0
for r in P:
    if min>=r:
        min=r
        cnt+=1
    else:
        continue
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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]:
#             break
#         else:
#             count+=1
#     if count==i+1:
#         ans+=1
# print(ans)

for i in range(n):
    l = p[:i+1]
    if max(l)>p[i]:
        ans+=1

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(N):
  if min(p[0:i+1])==p[i]:
    a+=1
    print(p[0:i+1])
print(a)

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:
        break 
    if P[i] > P[i+1]:
        count += 1

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
p = np.array(input().split(),dtype=int)

maxp = 0
ans = 0
for i in p:
    if i < maxp:
        maxp = i
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
p = np.array(input().split(),dtype=int)

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

print(ans)

Submission status: Wrong Answer

Solution code:
import random
N = int(input())
P = input().split()
k=[]
#Pの順列を作る
for i in range(N):
    k.append(int(P[i]))
count=0
print(k)
for i in range(N):
    j = random.randint(0,i)#任意の整数jを決める。
    #print(j)
    if k[i] <= k[j]:
        count+=1
print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.buffer.readline
n = int(input())
L=list(map(int,input().split()))
num=1
for i in range(n-1):
    if L[i]-L[i+1]>=0:
        num+=1
print(num)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.buffer.readline
n = int(input())
L=list(map(int,input().split()))
num=1
for i in range(n-1):
    if L[i]-L[i-1]>=0:
        num+=1
print(num)

Submission status: Wrong Answer

Solution code:
def main():
    input()
    t = list(map(int, input().split()))
    count = 1
    for i in range(1, len(t)):
        if t[i] <= t[i - 1]:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
c = list(map(int,input().split()))
c = c[::-1]
import bisect

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

print(len(LIS)) # 3
#print(LIS) # [1,3,5]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
p = list(int(i) for i in input().split())
p_test = sorted(p)
count = 1
for i in range(1,len(p)):
  if(p[i] <= min(p_test[0:i])):
    count += 1

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s=[p[0]]*(n+1)
for i in range(1,n+1):
    if s[i]>p[i-1]:
        s[i]=p[i-1]
    else:
        s[i]=s[i-1]

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

print(cnt)

Submission status: Wrong Answer

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

s=[p[0]]*(n+1)
for i in range(1,n+1):
    if s[i]>p[i-1]:
        s[i]=p[i-1]
    else: 
        s[i]=s[i-1]

if s[-1]>s[-2]:
    s[-1]=s[-2]

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

print(cnt)

Submission status: Wrong Answer

Solution code:
def main():
  N=int(input())
  P=list(map(int,input().split()))
  sumCount=0
  p0=P[0]
  for i in range(1,N):
    pi=P[i]
    if(p0<=P[i]):
      p0=P[i]
      sumCount=sumCount+1
  print(sumCount)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s=[p[0]]*(n+1)
for i in range(1,n+1):
    if s[i]>p[i-1]:
        s[i]=p[i-1]
    else: 
        s[i]=s[i-1]

if s[-1]>s[-2]:
    s[-1]=s[-2]

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

print(cnt)

Submission status: Wrong Answer

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

s=[p[0]]*(n+1)
for i in range(1,n+1):
    if s[i]>p[i-1]:
        s[i]=p[i-1]
    else: 
        s[i]=s[i-1]
s[-1]=s[-2]

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#152 Low Elements
n = int(input())
seq = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if i == 0:
        cnt+=1
        c = seq[0]
    else:
        num1 = seq[i-1]
        num2 = seq[i]
        if min(num1,num2) == num2:
            cnt += 1
        
print(cnt)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
ans=0
for i in range(n):
    if i==0:
        st.append(a[i])
    else:
        if st[-1]>=a[i]:
            ans+=1
        else:
            st.append(a[i])
print(ans)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

MIN = 10*100
cnt =0
for i in p:
  if i<=MIN:
    MIN = i
    cnt +=1
print(cnt)

Submission status: Wrong Answer

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

MIN = 10*10
cnt =0
for i in p:
  if i<=MIN:
    MIN = i
    cnt +=1
print(cnt)

Submission status: Wrong Answer

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

MIN = 10*10
cnt =0
for i in p:
  if MIN>i:
    MIN = i
    cnt +=1
print(cnt)

Submission status: Wrong Answer

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

MIN = 10*10
ans = []

for i in p:
  if MIN>i:
    MIN = i
  ans.append(MIN)
cnt =0
for i in range(n):
  if ans[i]>=p[i]:
    cnt +=1
print(cnt)

Submission status: Wrong Answer

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

MIN = 10*10
ans = []

for i in p:
  if MIN>i:
    MIN = i
  ans.append(MIN)
ans = [10*10] + ans
cnt = 0

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

Submission status: Wrong Answer

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

MIN = 10*10
ans = []

for i in p:
  if MIN>i:
    MIN = i
  ans.append(MIN)
ans = [999] + ans
cnt = 0

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

Submission status: Wrong Answer

Solution code:
n=int(input())
#n,p=map(int,input().split())
pl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

mn=pl[0]

mnl=[]
count=1
for i in range(n):
    mnl.append(min(mn,pl[i]))

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

Submission status: Wrong Answer

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

ans = 0
maxv = 0

for i in range(N):
    count = 0
    tmp = A[i]

    if tmp < maxv and tmp != 1:
        continue

    for j in range(i+1):
        if tmp <= A[j]:
            count += 1
        else:
            break

    if maxv < j:
        maxv = j

    if count == i+1:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

counter = 0


for i in range(n):
    min = p[i]

    for j in range(0,i):
        print("hogeb:"+str(p[j])+"&"+ str(p[i]))
        if min >= p[j]:
            min = p[j]

    if min == p[i]:
        counter += 1

print(str(counter))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,N):
    if A[i-1] >= A[i]:
        con += 1
print(con)

Submission status: Wrong Answer

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

for i in range(n-2):
	for j in range(i+1):
		if list[i+1] < list[j]:
			ans+=1
print(ans)

Submission status: Wrong Answer

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

for i in range(n-2):
	for j in range(i+1):
		if list[i+1] < list[j]:
			ans+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
lst=list(map(int,input().split()))
result=[]
for i in range(N):
  tf=True
  for j in range(i):
    if lst[i]<=lst[j]:
      tf=False
      break
  if tf:
    result.append(str(i+1))
print(' '.join(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
num=[]
a=input().split(" ")
ans=[]
for i in range(n):
    num.append(int(a[i]))
for i in range(n):
    count=0
    if i==0:
        ans.append(a[i])
    else:
        for j in range(0,i):
            if num[i]>num[j]:
                count+=1
        if count==0:
            ans.append(a[i])
print(ans)
print(len(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
num=[]
a=input().split(" ")
ans=[]
for i in range(n):
    num.append(int(a[i]))
for i in range(n):
    count=0
    if i==0:
        ans.append(a[i])
    else:
        for j in range(0,i):
            if a[i]>a[j]:
                count+=1
                break
        if count==0:
            ans.append(a[i])
print(len(ans))

Submission status: Wrong Answer

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

p_min = Pn[0]
cnt = 0
for i in Pn:
    if i <=p_min:
        cnt += 1
    p_min = min(p_min, i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    P=[int(_) for _ in input().split()]
    count=0
    min_p=10*6
    for i in range(n):
        if min_p>P[i]:
            count+=1
            min_p=P[i]
    print(count)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if x == 1:
        ans+=1
        break
    if min_v>=x:
        min_v=x
    else:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if x == 1:
        break
    if min_v>=x:
        min_v=x
    else:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 1
k = [0]
#ans = 1は最低保障
for i in range(N):
  #P_i <= P_jの判定
  #P[i]-P[i+1] < 0なら　+1 
  k.append(P[i])
  if k[i+1]-k[i] < 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int,input().split()))
ans = 1
#ans = 1は最低保障
for i in range(0,N-1):
  #P_i <= P_jの判定
  #P[i]-P[i+1] < 0なら　+1 
  if P[i+1]-P[i] < 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
p = list(map(int, readline().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:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))


N=input1()
p=input_array()
count=0
for i in p:
	flag=True
	for j in p[:i+1]:
		if i<=j:
			flag=True
		else:
			flag=False
			break
	if flag:
		count+=1
print(count)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
from collections import deque

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

mx = P[0]
mn = mx
count = 0

cut = list(filter(lambda x:mx >= x,P))
ans = deque()

for a in cut:
    if a == 1:
        break
    if mn >= a:
        mn = a
    else:
        cut.pop(cut.index(a))
print(len(cut))

Submission status: Wrong Answer

Solution code:
from collections import deque

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

mx = P[0]
mn = mx

cut = list(filter(lambda x:mx >= x,P))
for a in cut:
    if mn >= a:
        mn = a
    else:
        cut.pop(cut.index(a))
print(len(cut))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
P = [int(x) for x in input().split()]
cnt=1
tmp=P[0]
for i in range(1, N):
    if min(tmp, P[i-1]) >= P[i]:
        cnt+=1
#         print(i, cnt)
        
print(cnt)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
count = 1
past = 0
for i in numbers:
    if past > i:
        count += 1
        past = i
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
count = 0
past = 10 ** 6
for i in numbers:
    if past > i:
        count += 1
    past = i
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
count = 1
past = -9999999999999999999999999999
for i in numbers:
    if past > i:
        count += 1
    past = i
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
count = 1
past = 0
for i in numbers:
    if past > i:
        count += 1
    past = i
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
ans = 0
for i in range(N):
    if i == 0:
        ans = lists[i]
        count += 1
    else:
        if ans >= lists[i]:
            count += 1
            ans = lists[i]
        else:
            ans = lists[i]


    # lists_slice = lists[:i+1]
    # lists_min = min(lists_slice)
    # if lists_min >= lists[i]:
    #     count += 1
print(count)

Submission status: Wrong Answer

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

for i in range(n-1):
    Q= (P[:i+1])
    if min(Q)==P[i]:
        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(1,n):
  Q = (P[0:i+1])
  if max(Q)>P[i]:
        ans+=1

print(ans+1)

Submission status: Wrong Answer

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

for i in range(1,n-1):
  Q = (P[:i+1])
  if max(Q)!=P[i]:
        ans+=1
  if max(Q)==P[i]:
        ans+=0

print(ans+1)

Submission status: Wrong Answer

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

for i in range(n-1):
  Q = (P[:i+1])
  if max(Q)!=P[i]:
        ans+=1
  if max(Q)==P[i]:
        ans+=0

print(ans+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [int(i) for i in input().split()]
c = 0
for i, pi in enumerate(p):
    if pi > p[i-1]:
        continue
    if pi == min(p[:i+1]):
        c += 1
print(c+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

min_num = 3 * 10^5
count = 0

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 = [int(i) for i in input().split()]
count = 0
for i in p:
    for j in range(i):
        if p[i-1] <= p[j-1]:
            count += 1
            break
print(count)