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  =  [int(x) for x in input().split()]
j = 0
count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(input().split())
cnt = 0
cmp = p[0]

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

print(cnt)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

count = 0

for i in range(n-1):
  correct = True
  for j in range(i+1):
    if p[i] > p[j]:
      correct = False
      break;
  
  if correct:
    count += 1
    
print(count)

Submission status: Wrong Answer

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

print(len(a)+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(str, input().split()))
cnt = 0
for i, p1 in enumerate(P):
  satisfies_cond = True
  for j, p2 in enumerate(P):
    if i == 0 and j == 0:
      cnt += 1
      break
    if j == i and satisfies_cond is True:
      cnt += 1
      break
    if P[j] < P[i]:
      satisfies_cond = False
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = list(map(int, input().split()))
n = N
for i in range(1,N):
  if P[i] != min(P[0:i]):
    n -= 1
  else:
    pass
print(n)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int,input().split()))
miss = 0
for i in range(n):
    s = p[0:i]
    if not s:
        continue
    if p[i] > max(s):
        miss += 1
        continue
 
    #s = sorted(s,reverse=True)
    #for j in range(i):
    #    if p[i] > s[j]:
    #        miss += 1
    #        break

print(n-miss)

Submission status: Wrong Answer

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

prei = 0
count = 0

for i in p:
  if i < prei:
    prei = i
    count += 1
  else:
    break
print(count)

Submission status: Wrong Answer

Solution code:

if __name__ == "__main__":
    N = int(input())
    P = input().split()
    cnt = 0
    for i in range(N):
        cnt = len([1 for x in P if x>=P[i]])
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
P=input()
x=0
a=1
if N==1:
    print(a)
else:
    for i in range(N-1):
        if P[x]>=P[i+1]:
            x=i+1
            a+=1
    print(a)

Submission status: Wrong Answer

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

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

ans = 0
pivot = 0

for i in range(0, len(P)):
    if (pivot >= P[i]):
        ans += 1
        pivot = P[i]
    else:
        pivot = P[i]

print(ans+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc152/tasks/abc152_c
# -*- coding: utf-8 -*-
N = int(input())
P = input().split()
T = [0]*(N-1)
T.insert(0,1)
for i in range(len(P)):
  P[i] = int(P[i])
for i in  range(1,len(P)):
  if P[i]<=P[i-1]:
    T[i] = 1
print(T.count(1))

Submission status: Wrong Answer

Solution code:
n = int(input())
p_L = list(map(int,input().split()))
L = sorted(p_L,reverse=True)
ans = 0


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

print(ans)

Submission status: Wrong Answer

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

for i, p in enumerate(P):
    if min(P[:i+1]) >= p:
        count = count+1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in P:
    if j<len(P):
        if int(i) > int(P[j]):
            count+=1
            j+=1
        else:
            j+=1
    else:
        if int(i) > 0:
            count+=1
print(count)

Submission status: Wrong Answer

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

cnt_1 = 1

num = P.index(min(P))
for i in range(num):
  for j in range(i):
    if P[i] > P[j]:
      break
    
    elif i-1 == j:
      cnt_1 += 1
    
    else:
      continue

cnt_2 = P[num:N].count(min(P))

print(cnt_1+cnt_2)

Submission status: Wrong Answer

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

for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = Pi

    elif Pmin>P[i]:
        count = count +1
        Pmin = Pi

print(count)

Submission status: Wrong Answer

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

if N == 1:
  print(1)
else:
  c = 1
  tmp = lst[0]
  for i in range(1, N):
    if lst[i-1] > lst[i]:
      tmp = lst[i]
      c += 1
  print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def main():
    n = int(input())
    tmp = input().split(" ")
    p = []
    cnt = 0
    for i in range(n):
        p.append(int(tmp[i].replace('\n', '')))
        p2 = p
        p2[0:i].sort()
        if p2[0] < p[i]:
            cnt += 1
    print(n - cnt)


if __name__ == '__main__':
    input = sys.stdin.readline
    main()

Submission status: Wrong Answer

Solution code:
N = input()
Pn = input().split()
result = 0
last = Pn[0]  # 初期化

for i in Pn:
    if int(last) >= int(i):
        result += 1
    last = int(i)

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int,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=int(input())
i=list(map(int,input().split()))
l=[[0,0]]*n
for k in range(len(i)):
  l[k]=[i[k],k]
l.sort(reverse=True)
p=n+1
a=0
for k in range(len(i)):
  if l[k][1]<p:
    p=l[k][1]
    a+=1
print(str(a))

Submission status: Wrong Answer

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

cnt = int(n)

for i in range(int(n)):
    if i == 0:
        min = p[i]
    if p[i] > min:
        cnt = cnt - 1
    else:
        if(min > p[i]):
            min = p[i]
print(cnt)

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')
count = 0
PM = min(P)
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = Pi

    elif Pmin>=P[i]:
        count = count +1
        Pmin = Pi

print(count)

Submission status: Wrong Answer

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

ans = 0
tmp = 0
P.append(0)
for i in P:
  if i < tmp:
    ans += 1
  tmp = i
print(ans)

Submission status: Wrong Answer

Solution code:
input_list=[input() for i in range(2)]
N = int(input_list[0])
P_s = list(map(int,input_list[1].split()))	
output_s = 0
for i in range(N):
    output_num = 0
    for j in range(i+1):
        print(i, j)
        if P_s[i] > P_s[j]:
            output_num += 1
            break
    if output_num <= 0:
        output_s += 1

print(output_s)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=list(range(x))
y=list(map(int,input().split()))
c=0
d=True
for i in range(0,x):
  for l in range(0,i+1):
    if y[l]<y[i]:
      d=False
      break
  if d==True:
    c+=1
  else:
    d=True
  if y[i]==max(y):
    break
print(c)

Submission status: Wrong Answer

Solution code:
N = input()
lis = input().split(" ")
cnt = 0
for i in range(int(N)):
  for j in range(i,-1,-1):
      if int(lis[i])>int(lis[j]):
        cnt += 1
        break
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

#cnt = N
#
#for i in range(N):
#  for j in range(i):
#    if(P[i] <= P[j]):
#      None
#    else:
#      cnt -= 1
#      break
#p_zero = P[0]
#if( N >= 2 ):
#  if( P.index(1) != N ):
#    
#  for i in range(N):
#
#else:
#  cnt = 1

i_before = N + 1
for i in range(N):
  if(min(i_before, P[i]) >= P[i]):
    cnt += 1
  i_before = P[i]
  
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = input().split()

nums_i = [int(s) for s in nums]


ans = 1

for i in range(len(nums_i)-1):
    if nums_i[i] > nums_i[i+1]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
Pn = input().split()
result = 0
last = Pn[0]  # 初期化

for i in Pn:
    if int(last) >= int(i):
        print(i)
        result += 1
    last = int(i)

print(result)

Submission status: Wrong Answer

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

counter = 0
for i in range(N):
    if int(P[i]) > int(P[i+1]):
        counter += 1

print(counter)

Submission status: Wrong Answer

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

if N == 1:
  print(1)
else:
  ans = []
  for i in range(N - 1):
    a = P[i:]
    n = [a[0]]
    for j in range(1, len(a)):
      if n[-1] >= a[j]:
        n.append(a[j])
    ans.append(len(n))
  print(max(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(len(a)+1)

Submission status: Wrong Answer

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

while True:
    if tmpMinIndex == 0:
        break
    li = li[0:tmpMinIndex]
    print(li)
    minNum = min(li)
    print(minNum)
    tmpMinIndex = li.index(minNum)
    count += 1


print(count)

Submission status: Wrong Answer

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

while i>0:
  a=a[0:a.index(min(a))]
  print(a)
  b+=1
  i=len(a)
print(b)

Submission status: Wrong Answer

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


if N == 1:
  print(1)
else:
  c = 1
  tmp = lst[0]
  for i in range(1, N):
    if lst[i-1] > lst[i]:
      tmp = lst[i]
      c += 1
  print(c)

Submission status: Wrong Answer

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

count =0

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

count = N-count

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#5 4 2 3 1

N = int(raw_input())
array = map(int, raw_input().split())

num = N

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

print num

Submission status: Wrong Answer

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

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

    ma = p[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
P = input().split(' ')
count = 0
PM = min(P)
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = Pi

    elif Pmin< P[i]:
        pass
    else:
        count = count +1
        Pmin = Pi
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1

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

print(count)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc152/tasks/abc152_c
# -*- coding: utf-8 -*-
N = int(input())
P = input().split()
T = [1]*N
for i in range(len(P)):
  P[i] = int(P[i])
for i in  range(1,len(P)):
  if P[i]>=P[i-1]:
    T[i] = 0
print(T.count(1))

Submission status: Wrong Answer

Solution code:
n=int(input())
l1=list(map(int,input().split())) 
cnt=0
max1=l1[0]
for i in range(len(l1)):
    
    if l1[i]<=max1:
        cnt=cnt+1
    max1=max(max1,l1[i])    
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
s=list(map(int,input().split()))
s2=[]
for i in range(n-1):
    s2.append(s[i+1]-s[i])
ans=1

for j in range(n-1):
    if s2[j]<0:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
Pn = input().split()
result = 1
last = 0  # 初期化

for i in Pn:
    if int(last) >= int(i):
        result += 1
    last = i

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
P_list = np.array([int(i) for i in input().split()])

# N = 5
# P_list = np.array([4, 2, 5, 1, 3])

# N = 1
# P_list = np.array([1])
# N = 8
# P_list = np.array([7 ,4 ,2 ,6 ,8 ,1 ,3])

count = 0

for i, p in enumerate(P_list, start=1):
    if np.sum(P_list[:i] >= p) != 0:
        count += 1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(sysinput())
P = list(map(int, sysinput().split()))
memo_mini = N
i_count = 1
for i in range(1, N):
  if memo_mini > P[i]:
      i_count +=1
      memo_mini = P[i]
  else:
    pass
  
print(i_count)

Submission status: Wrong Answer

Solution code:
class MyList(list):
    def last_index(self):
        return len(self)-1

N = int(input())
P = MyList(map(int, input().split()))
temp = P.last_index()
j=1
count = 0

for i in P:
    if j<len(P):
        if i > P[j]:
            count+=1
            j+=1
        else:
            j+=1
    else:
        if temp > 0:
            count+=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
pl=list(map(int, input().split()))

if len(pl) == 1:
    print(1)
else:
    pl = np.array(pl)
    pr = np.roll(pl, 1)
    pd = pr - pl
    pd[0] = 0
    print(np.count_nonzero(pd > 0)+1)

Submission status: Wrong Answer

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

j = 1
for i in range(1,N - 1):
  sort_list = sorted(p_list[0:i+1])
  if p_list[i] <= sort_list[0]:
    j = j + 1

print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = int(1)
ANS = int(0)

for i in range(1,n):
  for j in range(0,i):
    if p[i] <=p[j]:
      ANS += 1
      if ANS == i:
        ans += 1
        ANS = 0
        continue
    else:
      break

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int,input().split()))
ans=0
for i in range(N):
    flg=None
    for j in range(i):
        if P[i]-1 > P[j]:
            break
        else:
            flg=True
    ans += 1 if flg is True else 0
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=input()
x=0
a=1
if N==1:
    print(a)
else:
    for i in range(N-1):
        if P[x]>=P[x+1]:
            a+=1
            x+=1
        else:
            x+=1
    print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

INF = 99999999

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

mins = [INF] * N

ans = 1
mins[0] = P[0]

for i in range(1,N):

    if (mins[i-1] > P[i]):
        ans += 1
        mins[i] = P[i]
#        print("i:" + str(i));
#        print(mins);
    else:
        mins[i] = mins[i-1]

Submission status: Wrong Answer

Solution code:
N=int(input())
p=list(map(int,input().split()))
a=[]
for i in range(1,N):
    if p[i-1]>=p[i]:
     a.append(p[i])
c=set(a)

print(len(c)+1)

Submission status: Wrong Answer

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

count = 1

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

Submission status: Wrong Answer

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

for i in range(N-1):
    if P[i]>P[i+1]:
        down += 1
    elif P[i]<P[i+1]:
        up += 1


if up>down:
    down += 1
else:
    up += 1

if up==N-1:
    print(1)
elif up==N-1:
    print(N)
else:print(max(up,down))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ret = 1
c_min = 2e5

for i in range(1, len(p)):
    if c_min > p[i]:
        c_min = p[i]
        ret+=1
print(ret)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int,input().split()))
miss = 0
for i in range(n):
    s = p[0:i]
    s = sorted(s,reverse=True)
    print(s)
    for j in range(i):
        if p[i] > s[j]:
            miss += 1
            break

print(n-miss)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
pl=list(map(int, input().split()))

if len(pl) == 1:
    print(1)
else:
    side = pl[0] - pl[-1]
    cnt = 1 if side >= 0 else 0
    pl = np.array(pl)
    pr = np.roll(pl, 1)
    pd = pr - pl
    print(np.count_nonzero(pd >= 0)+cnt)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=1
c=min(A)
for i in range(1,len(A)):
    if max(A[0],A[i-1])<A[i]:
        pass
    else:
        count+=1
    if A[i]==c:
        break
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
P = input().split()
ngCount = 0
for i in range(N + 1):
    for j in range(i):
        Pi = P[i - 1]
        Pj = P[j]
        if Pi > Pj:
            ngCount += 1
            break
print(N - ngCount)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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



mini=1
count=1
index_min=P.index(mini)
for i in range(N):
  P=P[:index_min+1]
  mini=min(P)
  index_min=P.index(mini)
  count+=1
  if mini==P[0]:
    break
  
"""
count=1
for i in range(1,N):
  if min(P[:i+1])==P[i]:
    count+=1
"""
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = list(map(int,input().split()))
#n = 5
#p = [4,2,5,1,3]
maxcnt = 1
cnt = 1
for i in range(n):
    box = 0
    cnt = 1


    for j in range(n):
        if i == j :
            box = p[i]
        if i < j and box >= p[j]:
            box = p[j]
            cnt += 1
            if maxcnt < cnt :
                maxcnt = cnt
            
print(maxcnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=list(map(int,input().split()))
ans=0
for i in range(N):
    flg=None
    for j in range(i):
        if P[i] > P[j]:
            break
        else:
            flg=True
    ans += 1 if flg is True else 0
print(ans)

Submission status: Wrong Answer

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

cnt = int(n)

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
num = int(input())
listNum = list(map(int,input().split()))
Ans = 0 
word = 2000000
for i in range(num):
  if word >= listNum[i]:
    Ans += 1
  word = listNum[i]

print(Ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
if a[0]==1:
  print(1)

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

count = 1

for i in range(0,len(s)):
  if i == 0:
    continue
  elif s[i-1] > s[i]:
    count +=1
print(count)

Submission status: Wrong Answer

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

for i in range(N):
    if data > li[i]:
        ans += 1
        data = li[i]

print(ans)

Submission status: Wrong Answer

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

h =0

for num in range(n):
    hf=0
    for ng in range(num+1,n):
        #print(pi[num],pi[ng])
        if(pi[num] > pi[ng]):
            #print(">")
            hf = hf+1
    if(hf>0): h=h+1
    
print(h)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
if a[0]==1:
  print(1)
else:
  print(n-a[0]+1)

Submission status: Wrong Answer

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

count = 0
min =9999999

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

print(count)

Submission status: Wrong Answer

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

count = 1

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
p=list(map(int,input().split()))
p=np.array(p)
m=1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
lis = []
from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
lc = lcm(A)
for i in range(n):
    lis.append(lc//A[i])
print(sum(lis) % (10**9+7))

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
p=list(map(int,input().split()))
p=np.array(p)
m=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
DEBUG = False

def dprint(*args):
    if DEBUG:
        print(*args)

n = int(input())
p = [int(i) for i in input().split(' ')]
so = [p.pop(-1)]
max_len = 1
dprint(n, p, so)

for i in reversed(p):
  if so[-1] < i:
    so.append(i)
    if max_len < len(so):
      max_len = len(so)
  else:
    for index, j in enumerate(so):
      if i < j:
        new_so = so[0:index] + [i]
        break
    so = new_so
  dprint(so, max_len)
print(max_len)

Submission status: Wrong Answer

Solution code:
input_list=[input() for i in range(2)]
N = int(input_list[0])
P_s = list(map(int,input_list[1].split()))	
output_s = 0
for i in range(N):
    print(i, "--------")
    output_num = 0
    for j in range(i+1):
        if P_s[i] > P_s[j]:
            print(i, j, "+1")
            output_num += 1
        else:
            output_num += 0
            print(i, j, "0")
    if output_num > 0:
        output_s += 0
    else:
        output_s += 1
    
print(output_s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

dp = [0]*n;
flg = [1]*n;
comp = n+1;

for i in range(1,n) :
	if p[i-1] < p[i] :
		comp = p[i-1];
	if p[i] > comp :
		flg[i] = 0;

print(sum(flg));

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1

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

Submission status: Wrong Answer

Solution code:
N = input()
lis = input().split(" ")
cnt = 0
for i in range(int(N)):
  dum = lis[:i+1]
  if min(dum) == lis[i]:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

ret = 1
for i in range(1, len(p)):
    if max(p[:i]) > p[i]:
        ret +=1
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())
plist=[int(_) for _ in input().split()]

if n == 1:
  print("1")
  sys.exit()

result = 1
temp = 2*100000
for i in range(1,len(plist)):
  temp = min(plist[i],temp)
  if plist[i] <= temp:
    result += 1

print(result)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc152/tasks/abc152_c
# -*- coding: utf-8 -*-
N = int(input())
P = input().split()
T = [1]*N
for i in range(len(P)):
  P[i] = int(P[i])
for i in  range(1,len(P)):
  if P[i]>P[i-1]:
    T[i] = 0
print(T.count(1))