ZhenlongDai/ACPR huggingface dataset:
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int,input().split()))
ans = 1
for i in range(n-1):
    if p[i+1] <= p[i]:
        ans += 1
        
print(ans)

Failing test case input:
6
0 2 2 2 5 9

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int,input().split()))

ls = [p[0]]
ans = 1

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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)

Failing test case input:
6
1 2 3 4 5 4

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):



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

Min = P[0]
count = 1

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

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = tuple(map(int, input().split()))
cnt = N
for a in P:
    for b in P[:P.index(a)+1]:
        if a > b:
            cnt=-1
            break
print(cnt)

Failing test case input:
6
1 6 18 0 5 11

Expected output:
2


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
cnt = 0
max = 2*10**5
for a in P:
    if a <=max:
        
        cnt += 1
    max = min(max,a)
print(cnt)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
0 3 1 3 4 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = [int(i) for i in input().split(" ")]
count = 0
pmax = max(P)
for i in range(N):
    if P[i]<= pmax:
        pmax=P[i]
        count+=1

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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


    


print(n-count)


Failing test case input:
6
0 3 1 3 2 27

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
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):
    if min_i[i-1] < x[i]:
        count=count+1


    


print(n-count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
6
1 2 2 3 9 9

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
*p, = map(int, input().split())

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
0 3 2 3 3 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
list = list(map(int, input().split()))
ans=0
min=n+1
for i in range(n):
	if list[i]<min:
		min = list[i]
		ans+=1
print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


n = int(input())
seq = [int(e) for e in input().split(' ')]

count = 1

for idx, i in enumerate(seq[1:]):
  if i > idx+2:
   continue
  else:
    count += 1
print(count)

Failing test case input:
6
1 2 2 3 5 9

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
seq = [int(e) for e in input().split(' ')]

count = 1

current_min = seq[0]

for idx, i in enumerate(seq[1:]):
  if i < current_min:
    current_min = i
    count += 1
print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))
a=1
i=0
while i != N:
    if P[i] <= P[i-1]:
        a+=1
    i+=1
print(a)


Failing test case input:
6
1 2 4 4 5 4

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
a=1
i=0
b = P[0]
for i in range(1,N):
    if P[i] <= b:
        a+=1
        b = P[i]
print(a)

Problem: p02791
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
d = list(map(int, input().split()))

c = 1

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

print(c)

Failing test case input:
6
0 19 17 -1 2 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
d = list(map(int, input().split()))

c = 1
a = d[0]

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

print(c)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))
ans = 0
maximum = 0
for p in P:
  if p >= maximum:
    maximum = p
    ans += 1
print(ans)

Failing test case input:
6
1 2 0 6 5 9

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
ans = 0
minimum = 200001
for p in P:
  if p <= minimum:
    minimum = p
    ans += 1
print(ans)
Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = [1]
    for i in range(1,N):
        j = i - 1
        if P[i] > P[j]:
            odp.append(odp[j])
        else: 
            odp.append(odp[j]+1)
    print(odp[N-1])
    
mniejsze_elementy()

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista 

def mniejsze_elementy(): 
    N = wczytaj_liste()[0]
    P = wczytaj_liste()
    odp = 1 
    najmniejszy_dotychczas = P[0]
    for i in range(1,N):
        if P[i]< najmniejszy_dotychczas: 
            odp += 1
            najmniejszy_dotychczas = P[i]
    print(odp)
    
mniejsze_elementy()

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = [int(x) for x in input().split()]
ans = 1
for i in range(N-1):
    if P[i] > P[i+1]:
        ans += 1
print(ans)


Failing test case input:
6
0 33 17 -1 2 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
P = [int(x) for x in input().split()]
ans = 1

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
da = list(map(int,input().split()))
ans = 0
now_max = 0
for i in range(n):
  if now_max < da[i]:
    ans += 1
    now_max = da[i]
print(ans)

Failing test case input:
6
1 16 17 -1 2 19

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
da = list(map(int,input().split()))
ans = 0
now_min = n+1
for i in range(n):
  if now_min > da[i]:
    ans += 1
    now_min = da[i]
print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p < min_p:
    min_p = p
    cnt += 1
print(cnt)


Failing test case input:
5
3 2 5 1 3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

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

print(result)

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())

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

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

print(result)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



n = int(input())

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

l = []

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

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

ans = 0

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

print(ans)

Failing test case input:
6
0 2 3 2 10 9

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):



n = int(input())

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

m = p[0]
ans = 0

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


print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      counter = counter + 1
    else:
      minNum = S[i]
    
  print(counter)

Failing test case input:
6
1 6 9 0 2 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      minNum = S[i]
      counter = counter + 1
    
  print(counter)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main(length_num,num_list):
    count_num = 0
    for i in range(0,length_num):
        temp_list = num_list[0:i+1]
        temp_list.sort()
        if int(temp_list[0]) >= int(num_list[i]):
            count_num += 1           
    return count_num
    
if __name__ == "__main__":
    input_length_num = int(input())
    input_num2 = input()
    input_num_list = input_num2.split()
    print(main(input_length_num,input_num_list))

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
7


Fixed submission (verdict: Accepted):
def main(length_num,num_list):
    count_num = 0
    min_num = int(num_list[0])
    for i in num_list:
        if int(min_num) >= int(i):
            min_num = i
            count_num += 1           
    return count_num
    
if __name__ == "__main__":
    input_length_num = int(input())
    input_num2 = input()
    input_num_list = input_num2.split()
    print(main(input_length_num,input_num_list))
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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]


    
    
    
    
print(count)

Failing test case input:
6
1 2 3 0 9 9

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
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 = min(ans, lists[i])
        else:
            ans = min(ans, lists[i])


    
    
    
    
print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=1
for i in range(1,N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

Failing test case input:
6
1 6 17 0 2 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=P[0]
cnt=1
for i in range(1,N):
    if P[i]<=mn:
        mn=P[i]
        cnt+=1
print(cnt)

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    from sys import stdin, setrecursionlimit
    
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    
    
    
    a = list(map(int, r.split()))
    
    
    

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

    
    
    
    

if __name__ == '__main__':
    main()



Failing test case input:
6
-1 2 3 2 5 9

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    from sys import stdin, setrecursionlimit
    
    n = int(stdin.readline()[:-1])   
    r = stdin.readline()[:-1]
    
    
    
    a = list(map(int, r.split()))
    
    
    

    res = 1
    bk = a[0]
    for i in range(1,n):
        if bk >= a[i]:
            bk = a[i]
            res += 1
    print(res)
















if __name__ == '__main__':
    main()

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
1 3 2 2 5 9

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
B=list(map(int,input().split()))
cnt=0
maxi=max(B)
for i in range(n):
  if maxi>=B[i]:
    cnt+=1
    maxi=B[i]
print(cnt)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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) 


Failing test case input:
6
1 2 3 0 9 9

Expected output:
2


Actual output:
2
3
0
9
9
3


Fixed submission (verdict: Accepted):
n = input()
p = list(int(i) for i in input().split())
count = 1
min_num = min(p[0:1])
for i in range(1,len(p)):
  if(p[i] <= min_num):
    count += 1
    min_num = p[i]

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
-1 3 3 5 5 9

Expected output:
1


Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
k = list(map(int, input().split()))

count = 1

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

print(count)


Failing test case input:
6
0 4 2 3 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
a = int(input())
k = list(map(int, input().split()))

count = 0
min =99999999

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

print(count)

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
P = list(map(int,input().split()))


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

print(counter)

Failing test case input:
6
1 0 3 4 5 9

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int,input().split()))


inf = float("inf")
minimum = inf
counter = 0
for i in range(N):
    if P[i]<minimum:
        minimum = P[i]
        counter += 1

    

print(counter)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

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

print(count)


Failing test case input:
6
0 3 2 2 5 27

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())

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

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))




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















print(count)


Failing test case input:
6
1 5 3 4 5 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

result = 0
m = P[0]
for i in range(N):
    if P[i] <= m:
        result += 1
        m = P[i]
print(result)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int,input().split()))
count = n

for i in range(1, n):
    for j in range(n):
        if p[i] > p[j]:
            count -= 1
            break
            
print(count)

Failing test case input:
8
5 7 4 2 6 8 1 3

Expected output:
4

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]

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

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
List=list(map(int,input().split()))
num=0

for i in range(N-1):
  if List[i]>=List[i+1]:
    num = num + 1
  else:
    break

print(num+1)

Failing test case input:
5
3 2 5 1 3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
List = list(map(int, input().split()))
num = 0
min = List[0]
for i in range(N):
  if List[i] <= min:
    num += 1
    min = List[i]
print(num)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
P=list(map(int,input().split()))
b=0
a=0
for i in range(N):
  if P[i]<=b:
    b=P[i]
    a+=1
print(a)
    


Failing test case input:
6
1 5 3 4 5 6

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())
P=list(map(int,input().split()))
b=N
a=0
for i in range(N):
  if P[i]<=b:
    b=P[i]
    a+=1
print(a)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
5
3 2 5 -1 1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
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])
print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))
ans = 1
maximum = 0
for p in P:
  if p >= maximum:
    maximum = p
    ans += 1
print(ans)


Failing test case input:
6
2 5 3 4 5 6

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
ans = 0
minimum = 200001
for p in P:
  if p <= minimum:
    minimum = p
    ans += 1
print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().split()))

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

Failing test case input:
6
-1 4 2 2 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
A=list(map(int,input().split()))
a=A[0]
ans=1
for n in range(1,N):
  if a>A[n]:
    ans+=1
    a=A[n]
print(ans)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
Pn = input().split()
result = 1
last = 0  

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

print(result)


Failing test case input:
6
1 2 4 4 5 4

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
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)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
li = list(map(int,input().split()))
ans = 1
data = 0

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

Failing test case input:
6
-1 3 3 3 5 18

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
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)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

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

print(ans) 

Failing test case input:
6
0 3 1 2 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


if __name__ == "__main__":
    main()

Failing test case input:
6
2 6 9 0 2 11

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import sys

def main():
    input = sys.stdin.readline

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

    

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

        
        






    

if __name__ == "__main__":
    main()

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
List=list(map(int,input().split()))
num=0

for i in range(N-1):
  if List[i]<=List[i+1]:
    num = num + 1
  else:
    break

print(num+1)

Failing test case input:
6
1 5 9 0 5 6

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
List = list(map(int, input().split()))
num = 0
min = List[0]
for i in range(N):
  if List[i] <= min:
    num += 1
    min = List[i]
print(num)
Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

Failing test case input:
6
0 33 17 -1 2 19

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))
m = 10**100
ans = 0

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
2 6 9 0 2 11

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):

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

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
P = input().split(' ')

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

Failing test case input:
8
5 14 4 2 6 8 1 3

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = int(Pi)

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


print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

ans = 0
tmp = 0
for i in P:
  if i > tmp:
    ans += 1
  tmp = i
print(N - ans + 1)

Failing test case input:
6
0 4 2 3 5 27

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

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

print(count)


Failing test case input:
5
3 2 5 -1 1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

count = 1
if N == 1:
  print(count)
else:
  min = P[0]
  if P[1] <= P[0]:
    count+=1
    min = P[1]

  for i in range(2,N):
    if P[i] <= min:
      count+=1
      min = P[i]
  print(count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int,input().split()))
min = p[0]
c = 0
 
for smp in p:
  if(min >= smp):
    min = smp
    print(min)
    c += 1
 
print(c)

Failing test case input:
6
-1 4 2 2 5 27

Expected output:
1


Actual output:
-1
1


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

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


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()

Failing test case input:
6
1 5 3 4 5 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):


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

if __name__ == '__main__':
  main()

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int, input().split()))

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

Failing test case input:
6
0 3 1 3 2 27

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int, input().split()))

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
0 3 2 3 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
p_ls = list(map(int,input().split()))
min_ = float('inf')
count = 0
for i in range(n):
    if p_ls[i] < min_:
        count += 1
        min_ = p_ls[i]
print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int,input().split()))
value = p[0]
ans = 1

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

print(ans)

Failing test case input:
6
1 4 0 4 5 6

Expected output:
2


Actual output:
0
2


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int,input().split()))
value = 1000000000
ans = 0

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

print(ans)
Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

Failing test case input:
6
1 4 3 4 5 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
p=list(map(int,input().split()))
a=[]
k=p[0]
for i in range(1,N):
    if k>p[i]:
     a.append(p[i])
     k=p[i] 
print(len(a)+1)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
5
3 2 5 0 3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
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]
        continue
    if p[i] <= m:
        answer += 1
        m = p[i]

print(answer)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

memo = [0] * N
memo[0] = 1
minn = 0
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))


Failing test case input:
5
3 2 5 0 3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))

Problem: p02791
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

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

Failing test case input:
6
1 0 3 6 29 9

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
c=list(map(int,input().split()))
q=sorted(c)[::-1]
count=0
for i in range(len(c)):
  if c[i]<q[i]:
    count+=1
print(count)


Failing test case input:
6
1 2 2 2 5 9

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
c=list(map(int,input().split()))
minimum=100000000
count=0
for i in range(len(c)):
    if c[i]<minimum:
        minimum=c[i]
    if c[i]<=minimum:
        count+=1
print(count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = input().rstrip().split()
P = [0] * N
for i in range(N):
  P[i] = int(a[i])
minP = P[0]
ans = 1
for i in range(N - 1):
  if P[i] >= P[i + 1]:
    ans += 1
    minP = P[i + 1]
print(ans)

Failing test case input:
6
1 0 3 6 9 9

Expected output:
2


Actual output:
3


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

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
p=list(map(int, input().split()))

cnt=1
min_v=p[0]

for i in range(1,n):
  if p[i]>=min_v:
    cnt+=1
  else:
    min_v=p[i]

print(cnt)


Failing test case input:
8
5 7 4 2 6 8 1 3

Expected output:
4

Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
p=list(map(int, input().split()))

cnt=1
min_v=p[0]

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

print(cnt)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = list(map(int, input().split()))

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

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

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

print(count)


Failing test case input:
6
0 3 1 2 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
l = list(map(int, input().split()))

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

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

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

print(count)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
p=input().split()
cnt=0
min=p[0]
for i in p:
  if i<=min:
    cnt=cnt+1
    min=i
print(cnt)

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
p=input().split()

cnt=0
min=int(p[0])
for i in p:
  if int(i)<=min:
    cnt=cnt+1
    min=int(i)
print(cnt)

Problem: p02791
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, *aa = map(int, open(0).read().split())

aa = [0]+aa

bb = []

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



bb = bb[:-1]

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

Failing test case input:
6
1 2 3 6 9 17

Expected output:
1


Actual output:
6


Fixed submission (verdict: Accepted):
n, *aa = map(int, open(0).read().split())

bb = []

tmp = aa[0]
for a in aa:
    tmp = min(a,tmp)
    bb.append(tmp)



print(sum([a<=b for a, b in zip(aa, bb)]))
Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(1,n):
    if a[i-1]>a[i]:
        ans+=1
print(ans)

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1001001
res=0
for i in range(n):
    if ans>a[i]:
        res+=1
        ans=min(ans,a[i])
print(res)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
cmp = p[0]

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

print(cnt)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=[int(i) for i in input().split()]
l1=[]
c=0
l1.append(l[0])
for i in range(1,n):
  l1.append(min(l[i-1],l[i]))
for i in range(n):
  if(l[i]==l1[i]):
    c+=1
print(c)

Failing test case input:
6
-1 3 3 3 5 9

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
l=[int(i) for i in input().split()]
l1=[]
c=0
l1.append(l[0])
for i in range(1,n):
  l1.append(min(l1[i-1],l[i]))
for i in range(n):
  if(l[i]==l1[i]):
    c+=1
print(c)

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

Failing test case input:
6
0 2 3 2 5 9

Expected output:
1


Actual output:
99999999


Fixed submission (verdict: Accepted):
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(k)

Problem: p02791
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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

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

Failing test case input:
6
2 5 6 4 5 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int, input().split()))

m = p[0]
count = 1
for i in range(1,n):
    if m >= p[i]:
        m = p[i]
        count += 1
        
print(count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i,_ in enumerate(P):
  if (i==0):
    ans = 1
  else :
    if (P[i] <= P[i-1]):
      ans += 1

print(ans)

Failing test case input:
6
1 2 3 0 9 9

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

m = -1
ans = 0

for i, item in enumerate(P):
  if i==0:
    m = item
    ans += 1
  else :
    if (m >= item):
      m = item
      ans += 1
      
print(ans)

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import heapq
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    now = []
    heapq.heapify(now)
    ans = 0
    for i in range(N):
        heapq.heappush(now,P[i])
        if heapq.heappop(now)==P[i]:
            ans += 1
        heapq.heappush(now,P[i])
    print(ans)
if __name__ == '__main__':
    main()

Failing test case input:
6
-1 3 3 3 5 18

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    ls = [0 for _ in range(N)]
    ans = 0
    mins = 10**10
    for i in range(N):
        mins = min(mins,P[i])
        if mins==P[i]:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
P = list(map(int,input().split()))
curmin = float('inf')
ans = 0
for p in P:
    if p <= curmin:
        ans += 1
    curmin = p
print(ans)

Failing test case input:
6
1 2 3 0 9 9

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int,input().split()))
curmin = float('inf')
ans = 0
for p in P:
    if p <= curmin:
        ans += 1
        curmin = p
print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
List=list(map(int,input().split()))
num=0

for i in range(N-1):
  if List[i]<List[i+1]:
    num = num + 1
  else:
    break

print(num+1)

Failing test case input:
6
1 2 4 4 5 4

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
List = list(map(int, input().split()))
num = 0
min = List[0]
for i in range(N):
  if List[i] <= min:
    num += 1
    min = List[i]
print(num)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int,input().split()))
count = 0

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

Failing test case input:
6
1 2 2 3 9 9

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
p = list(map(int,input().split()))
count = 0
min = p[0]

for i in range(n):
  if p[i] <= min:
    count += 1
    min = p[i]
print(count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
P=list(map(int,input().split()))
M=0
c=0
for i in range(N):
  if M<P[i]:
    M=P[i]
    c+=1
print(c)
    

Failing test case input:
6
0 3 1 3 2 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
P=list(map(int,input().split()))
M=N
c=0
for i in range(N):
  if M>=P[i]:
    M=P[i]
    c+=1
print(c)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = list(map(int, input().strip().split()))

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

print(ans)

Failing test case input:
6
1 3 2 2 5 9

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):

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

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

print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
1 5 3 4 5 6

Expected output:
1


Actual output:
4


Fixed submission (verdict: Accepted):

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

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

Problem: p02791
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
P = list(map(int, input().split()))

cnt = 0



















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)
      

Failing test case input:
6
0 3 2 2 5 27

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int, input().split()))

cnt = 0

maxmax = max(P) + 1

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

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def input1():
	return int(input())


def input2():
	return map(int,input().split())


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)








Failing test case input:
5
4 2 5 0 3

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))


N=input1()
p=input_array()
count=0
min_int=0
for i in range(N):
	num=p[i]
	if i==0:
		min_int=num
		count+=1
	elif num<=min_int:
		min_int=num
		count+=1
		
print(count)
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

sum = 0

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

        if a[kk] > a[ll]:

            break
    else:
        sum += 1

print(sum)

Failing test case input:
1
-4

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

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

sum = 0
min = a[0]

for kk in range(n):
    if a[kk] <= min:
        sum += 1
        min = a[kk]
        
print(sum)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
    elif P[i - 1] < P[i]:
          pass  
    elif Pi == min(P):
        count = count +1
        break
    elif Pi<= min(P[0:i]):
        count = count +1
print(count)

Failing test case input:
8
5 14 4 2 6 4 1 3

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N = input()
P = input().split(' ')
count = 0
for i, Pi in enumerate(P):
    if i == 0:
        count = count +1
        Pmin = int(Pi)

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


print(count)

Problem: p02791
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
P = [int(x) for x in input().split()]
a = N
for i in range(N-1):
    if P[i] <= P[i+1]:
        a = a - 1
print(a)
    



Failing test case input:
6
1 4 2 2 5 27

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
P = list(map(int,input().split()))
x = P[0]
a = 1
for i in range(N-1):
    if x >= P[i+1] :
        a+=1
        x=P[i+1]
print(a)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
6
1 5 3 4 5 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,*p=map(int,open(0).read().split())
for i in range(1,n):
    p[i]=min(p[~-i],p[i])
print(len(set(p)))

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, *p = map( int, open(0).read().split())

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


Failing test case input:
1
-2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n, *p = map( int, open(0).read().split())
 
cnt = 0
min_val = 1000000
for i in range( len( p )):
  if p[i] < min_val:
    cnt += 1
    min_val = p[i]

print( cnt )
Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input("")
L = input("").split(" ")
suc = N

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

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

Failing test case input:
6
2 6 17 0 2 19

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = input("")
L = input("").split(" ")
suc = int(N)
min_ = 200001

for i in range(int(N)):
    if (L[i] == 1):
        min_= 1
        continue
    if (int(min_) < int(L[i])):
        suc -= 1
        continue
    if (int(min_) >= int(L[i])):
        min_ = L[i]
print(suc)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
p=list(map(int,input().split()))
a=1000000000
cnt=1
for i in range(1,n):
	if p[i]<=a:
		cnt+=1
		a=p[i]
print(cnt)


Failing test case input:
6
-1 2 3 2 5 9

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
p=list(map(int,input().split()))
a=p[0]
cnt=1
for i in range(1,n):
	if p[i]<a:
		cnt+=1
		a=p[i]
print(cnt)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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));

Failing test case input:
6
1 2 4 4 5 4

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
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] and p[i-1] < comp :
		comp = p[i-1];
	if p[i] > comp :
		flg[i] = 0;


print(sum(flg));

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
p = [int(i) for i in input().split()]

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

Failing test case input:
1
-4

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
ppp = list(map(int, input().split()))
curr = 10 ** 6
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Problem: p02791
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
6
2 6 9 0 3 11

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
li = list(map(int,input().split()))
cnt=0
min_num = 10**9

for i in li:
    if min_num >= i:
        cnt+=1
        min_num = i
print(cnt)