ZhenlongDai/ACPR huggingface dataset:
Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,*H = map(int,open(0).read().split())
maxLen = 0
tmpCnt = 0
for i in range(len(H)-1):
  if H[i] > H[1+1]:
    tmpCnt+=1
  else:
    maxLen = max(maxLen,tmpCnt)
    tmpCnt =0
print(maxLen)

Failing test case input:
5
1 11 28 3 3

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N,*H = map(int,open(0).read().split())
maxLen = 0
tmpCnt = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    tmpCnt += 1
  else:
    tmpCnt = 0
  maxLen = max(maxLen,tmpCnt)

print(maxLen)

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

maxi = 0
cnt = 0

for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
    else:
        maxi = max(maxi,cnt)
        cnt = 0
print(maxi)
    

Failing test case input:
5
12 7 8 4 3

Expected output:
2


Actual output:
1


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

maxi = 0
cnt = 0

for i in range(n-1):
    if h[i] >= h[i+1]:
        cnt += 1
    else:
        maxi = max(maxi,cnt)
        cnt = 0
    maxi = max(maxi,cnt)
print(maxi)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
b = [int(i) for i in input().split()]
maxcount = 0
maxindex = 0
count = 0
ind = 0
prev = -float('inf')
for index, val in enumerate(b):
    if val <= prev:
        count += 1
        if count > maxcount:
            maxcount = count
            maxindex = ind
    else:
        count = 0
        ind = index
    prev = val
print(maxindex)

Failing test case input:
7
4 4 8 6 6 5 5

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):
a = int(input())
b = [int(i) for i in input().split()]
maxcount = 0
maxindex = 0
count = 0
ind = 0
prev = -float('inf')
for index, val in enumerate(b):
    if val <= prev:
        count += 1
        if count > maxcount:
            maxcount = count
            maxindex = ind
    else:
        count = 0
        ind = index
    prev = val
print(maxcount)

Problem: p02923
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
H = input().split(' ')
H = [H[i] for i in range(N)]
max = 0
count = 0
for i in range(N-1):
  if H[i]>=H[i+1]:
    count += 1
    if max<count:
      max=count
  else:
    count = 0
print(max)

Failing test case input:
7
10 4 3 0 6 5 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = input().split(' ')
H = [int(H[i]) for i in range(N)]
max = 0
count = 0
for i in range(N-1):
  if H[i]>=H[i+1]:
    count += 1
    if max<count:
      max=count
  else:
    count = 0
print(max)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=map(int,input().split())
H=list(H)
print(N,H)
x=0
xmax=0
for i in range(1,N):
    if H[i-1]>=H[i]:
        x+=1
    else:
        x=0
xmax=max(x,xmax)
print(xmax)

Failing test case input:
4
-2 2 4 1

Expected output:
1


Actual output:
4 [-2, 2, 4, 1]
1


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

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()
H  = nl()

current = 0
ans = 0
for i in range(1,N-1):
    if H[i-1] >= H[i]:
       current +=1
    else:
        if current > ans: 
            ans = current
        currrent = 0

if current > ans:
    ans = current
print(ans) 

Failing test case input:
4
-2 2 4 0

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()
H  = nl()

current = 0
ans = 0
for i in range(0,N-1):
    if H[i] >= H[i+1]:
        current +=1
    else:
        ans = max(current,ans)
        current = 0

ans = max(current, ans)
print(ans)

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


ans = 0
cnt = 0
for i in range(N - 1):
    if H[i] >= H[i + 1]:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0
print(cnt)


Failing test case input:
7
64 7 0 1 2 -2 2

Expected output:
2


Actual output:
0


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


ans = 0
cnt = 0
for i in range(N - 1):
    if H[i] >= H[i + 1]:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0
ans = max(cnt, ans)
print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0
i = 0


while i <= N-2:
  if H[i] >= H[i+1]:
    count += 1
    i += 1
  else:
    result.append(count)
    i += count+1
    count = 0
    
result.append(count) 

print(max(result))

Failing test case input:
7
7 4 8 6 6 5 8

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
result = []
count = 0
i = 0

for i in range (N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    result.append(count)
    count=0



result.append(count) 

print(max(result))
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=list(map(int,input().split()))

flag=0
ans=0

for i in range(0,N-1):
    if H[i+1]-H[i]<=0:
        flag+=1
        ans=flag
    else:
        flag=0
        
ans=max(ans,flag)
        
print(ans)

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

Expected output:
3


Actual output:
2


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

flag=0
ans=0

for i in range(0,N-1):
    if H[i+1]-H[i]<=0:
        flag+=1
    else:
        ans=max(ans,flag)
        flag=0
        
ans=max(ans,flag)
        
print(ans)

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

count = 0
count_max = 0

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

print(count)

Failing test case input:
5
2 7 12 4 6

Expected output:
1


Actual output:
0


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

count = 0
counts = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        count += 1
    else:
        counts.append(count)
        count = 0
        
counts.append(count)
print(max(counts))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
*H, = map(int, input().split())


count_max = 0
count_temp = 0
flg = 0

for i in range(0, len(H)-1, 1):

    if H[i] < H[i+1]:
        if count_max < count_temp:
            count_max = count_temp
        count_temp = 0
        flg = 1

    count_temp = count_temp + 1

    if H[i+1]==H[len(H)-1]:
        if count_max < count_temp:
            count_max = count_temp
        flg = 1

if flg == 1:
    print(count_max-1)
else:
    print(0)

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

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
*H, = map(int, input().split())


count_max = 0
count_temp = 0
flg = 0

for i in range(0, len(H)-1, 1):

    if H[i] < H[i+1]:
        if count_max < count_temp:
            count_max = count_temp
        count_temp = 0
        flg = 1
        continue

    count_temp = count_temp + 1

    if H[i+1]==H[len(H)-1]:
        if count_max < count_temp:
            count_max = count_temp
        flg = 1

if flg == 1:
    print(count_max)
else:
    print(0)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
H = list(map(int, input().split()))
A = [0]*(n*1)
for i in range(2,n):
  A[n-i] = A[n-i+1] + (1 if H[n-i] >= H[n-i+1] else 0)
print(max(A))

Failing test case input:
5
4 17 7 8 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
H = list(map(int, input().split()))
A = [0]*(n*1)
for i in range(1,n):
  A[-(i+1)] = (A[-i] + 1 if H[-(i+1)] >= H[-i] else 0)
print(max(A))
Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
N=int(input())
b = -1
c = -1
r = 0
for i in list(map(int, input().split()))[::-1]:
    if i >= b:
        c += 1
    else:
        r = max(c, r)
        c = 0
    b = i
print(r)


Failing test case input:
7
36 7 0 1 3 -2 2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
N=int(input())
b = -1
c = -1
r = 0
for i in list(map(int, input().split()))[::-1]:
    if i >= b:
        c += 1
    else:
        r = max(c, r)
        c = 0
    b = i
print(max(c, r))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
 
H.reverse()
ans = 0
val = 0
for i in range(N-1):
    if H[i] <= H[i+1]:
        val +=1
    else:
        ans = max(ans,val)
        val = 0
 
print(ans)

Failing test case input:
7
10 7 3 0 3 0 2

Expected output:
3


Actual output:
1


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

H.reverse()
ans = 0
val = 0
for i in range(N-1):
    if H[i] <= H[i+1]:
        val +=1
        ans = max(ans,val)
        
    else:
        ans = max(ans,val)
        val = 0
        


print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


n=int(input())


h = [int(i) for i in input().split()]
ans=0
l=[]
for i in range(n):
    if i==0:
        break
    if h[i]>h[i-1]:
        l.append(ans)
        ans=0
    elif h[i]<=h[i-1]:
        ans+=1
l.append(ans)
print(max(l))

Failing test case input:
4
-1 2 4 0

Expected output:
1


Actual output:
0


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


n=int(input())


h = [int(i) for i in input().split()]
ans=0
l=[]
for i in range(n):
    if h[i]>h[i-1]:
        l.append(ans)
        ans=0
    elif h[i]<=h[i-1]:
        ans+=1
    if i ==0:
        ans=0
l.append(ans)
print(max(l))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = [int(i) for i in input().split()]

res = 0
cur_cnt = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    cur_cnt += 1
  else:
    if cur_cnt > res:
      res = cur_cnt
    cur_cnt = 0

print(res)

Failing test case input:
5
2 8 46 3 3

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
H = [int(i) for i in input().split()]

res = 0
cur_cnt = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    cur_cnt += 1
  else:
    cur_cnt = 0
  
  if cur_cnt > res:
      res = cur_cnt

print(res)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split(" ")))
M = 0
m = 0

print("len H is {}".format(len(H)))

for i in range(len(H) - 1):
    m = 0
    for j in range(i, len(H) - 1):
        if (H[j] >= H[j+1]):
            m = m + 1
        else:
            break
    M = max(M, m)
print(M)

Failing test case input:
4
0 0 0 10

Expected output:
2


Actual output:
len H is 4
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split(" ")))
M = 0
i = 0

while i < (N - 1):
    m = 0
    j = i
    if (M > N - i):
        break
    while j < (N - 1):
        if H[j] >= H[j+1]:
            m = m + 1
            j = j + 1
        else:
            break
    M = max(M, m)
    i = j + 1

print(M)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
H=[""]*N
H=list(map(int,input().split()))
count=0
countmax=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        count+=1
        if count>countmax and i==N-2:
            countmax=count
    else:
        countmax=count
        count=0
        


print(countmax)

Failing test case input:
4
-1 -1 0 10

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())
H=[""]*N
H=list(map(int,input().split()))
count=0
countmax=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        count+=1
        if count>countmax and i==N-2:
            countmax=count
    elif count>countmax:
        countmax=count
        count=0
    else:
        count=0

        


print(countmax)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(x) for x in input().split()]
z = 0
z_old = 0
x = a[0]
for i in range(1,n):
  if a[i] >= x:
    z += 1
    x = a[i]
  else:
    if z > z_old:
    	z_old = z
    z = 0
print(max(z, z_old))


Failing test case input:
5
4 10 8 8 6

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(x) for x in input().split()]
z = 0
z_old = 0
x = a[0]
for i in range(1,n):
  if a[i] > x:
    if z > z_old:
    	z_old = z
    z = 0
  else:
    z += 1
  x = a[i]
print(max(z, z_old))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = [int(i) for i in input().split()]
c = 1
max = 0
for i in range(n-1):
    if h[i] < h[i-1]:
        c+= 1 
    else:
        if max < c:
            max = c
        c = 1
if max < c:
    max = c
print(max)        

Failing test case input:
7
10 7 3 0 3 0 2

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
h = [int(i) for i in input().split()]
c = 0
max = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        c+= 1 
    else:
        if max < c:
            max = c
        c = 0
if max < c:
    max = c
print(max)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
inf=10*100
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*n
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        length[i+1]=1
        if i==0:
            length[i]=1
for i in range(n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
if len(cnt)==0:
    print(0)
else:
    print(max(cnt))

Failing test case input:
7
64 7 0 2 0 -2 5

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
inf=10*100
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*(n-1)+[1]
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        length[i+1]=1
        if i==0:
            length[i]=1
for i in range(1,n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
if len(cnt)==0:
    print(n-2)
else:
    print(max(cnt))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
hi = list(map(int, input().split()))
count = 0
maxcount = 0
for i in range(N - 1):
    if hi[i] >= hi[i + 1]:
        count += 1
    else:
        maxcount = count
        count = 0
if count > maxcount:
    maxcount = count
print(maxcount)

Failing test case input:
7
20 7 3 0 3 -1 2

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
hi = list(map(int, input().split()))
count = 0
maxcount = 0
for i in range(N - 1):
    if hi[i] >= hi[i + 1]:
        count += 1
    else:
        maxcount = max(count,maxcount)
        count = 0
if count > maxcount:
    maxcount = count
print(maxcount)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import gc
N = int(input())
H = list(map(int, input().split()))

best = 0
for i in range(N-1):
  a=0
  for j in range(i+1,N):
    if H[i] >= H[j]:
      a += 1
    else : break
  if a > best :
    best = a
  gc.collect()    
print(best)

Failing test case input:
7
64 3 0 4 0 -2 5

Expected output:
2


Actual output:
6


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

best = []
a = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    a += 1
  else : 
    best.append(a)
    a = 0
best.append(a)
print(max(best))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
  n = int(input())
  h = list(map(int, input().split()))
  ans, now = 0, 0
  for i in range(n-1):
    if h[i] < h[i+1]:
      now = 0
    else:
      if ans < now:
        ans = now
    now += 1
  print(ans)
  return 0
 
if __name__ == "__main__":
  solve()


Failing test case input:
7
20 7 0 0 3 -1 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
def solve():
  n = int(input())
  h = list(map(int, input().split()))
  ans, now = 0, 0
  for i in range(n-1):
    if h[i] < h[i+1]:
      now = 0
    else:
      now += 1
      if ans < now:
        ans = now
  print(ans)
  return 0
 
if __name__ == "__main__":
  solve()
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))

max_count =0
count = 0

for i in range(N-1):
    if(H[i]>=H[i+1]):
        count +=1
        
        if(H[i]==H[N-2]):
            if(count > max_count):
                max_count = count
                break
    else:
        if(count> max_count):
            max_count = count
            
            count =0
        continue
print(max_count)
    

Failing test case input:
7
7 5 3 6 6 5 5

Expected output:
3


Actual output:
2


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

max_count =0
count = 0

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

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

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

diff = []
for i in range(len(H)-1):
    diff.append(H[i+1]- H[i])

cnt = 0
ans = 0
for d in diff:
    if d<=0:
        cnt += 1
    else:
        if cnt >= ans:
            ans = cnt
        cnt = 0
        
print(ans)

Failing test case input:
5
12 4 10 4 3

Expected output:
2


Actual output:
1


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

diff = []
for i in range(len(H)-1):
    diff.append(H[i+1]- H[i])

cnt = 0
ans = 0
for d in diff:
    if d<=0:
        cnt += 1
        ans = max(cnt, ans)
    else:
        ans = max(cnt, ans)
        cnt = 0
        
print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = [int(h) for h in input().split()]

cnt = 0
ans = 0

i = 0

while i < N-1:
    if H[i] < H[i+1]:
        cnt = 0
        ans = max(ans, cnt)
    else:
        cnt += 1
    i += 1
ans = max(ans, cnt)
print(ans)


Failing test case input:
7
64 7 0 1 3 -2 2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
H = [int(h) for h in input().split()]

cnt = 0
ans = 0

i = 0

while i < N-1:
    if H[i] < H[i+1]:
        ans = max(ans, cnt)
        cnt = 0
    else:
        cnt += 1
    i += 1
ans = max(ans, cnt)
print(ans)

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

st = 0
fst = 0
tmph = -1
span = 0
for i in range(1,n):  
  if h[i] > h[i-1]:
    span = max(span,i-st) 
    st = i
    
span = max(span,n-1-st)

print(span)

Failing test case input:
5
12 4 10 4 5

Expected output:
1


Actual output:
2


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

st = 0
fst = 0
tmph = -1
span = 0
for i in range(1,n):  
  if h[i] > h[i-1]:
    span = max(span,i-1-st) 
    st = i
    
span = max(span,n-1-st)

print(span)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))

last = H[0]
cnt = 0
max_cnt = 0
for i in range(1, N):
    if last >= H[i]:
        cnt += 1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
        cnt = 0
    last = H[i]
print(max_cnt)


Failing test case input:
4
-1 0 2 1

Expected output:
1


Actual output:
0


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

last = H[0]
cnt = 0
max_cnt = 0
for i in range(1, N):
    if last >= H[i]:
        cnt += 1
        if cnt > max_cnt:
            max_cnt = cnt
    else:
        cnt = 0
    last = H[i]
print(max_cnt)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = input().split()

max = 0
count = 0
prev = H[0]
H.pop(0)
for h in H:
    if (prev >= h):
        count += 1
    else:
        if (max < count):
            max = count
        count = 0
    prev = h

if (max < count):
    max = count
print(max)

Failing test case input:
7
10 4 3 0 3 0 2

Expected output:
3


Actual output:
2


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

max = 0
count = 0
prev = H[0]
H.pop(0)
for h in H:
    if (prev >= h):
        count += 1
    else:
        if (max < count):
            max = count
        count = 0
    prev = h

if (max < count):
    max = count
print(max)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
l = input().split()
line = [int(l[i]) for i in range(N)]

pos = N-1
n = 0
max_m = 0

while (pos>0) :
  if line[pos-1] >= line[pos]:
    n += 1
  else:
    if n > max_m:
    	max_m = n
    n = 0
  pos -= 1
print(max_m)

Failing test case input:
4
-1 -1 2 10

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
l = input().split()
line = [int(l[i]) for i in range(N)]

pos = N-1
n = 0
max_m = 0

while (pos>0) :
  if line[pos-1] >= line[pos]:
    n += 1
  else:
    if max_m < n:
    	max_m = n
    n = 0
  pos -= 1
if max_m < n:
  max_m = n
print(max_m)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H_list = input().split()
A_list = []
H_list.reverse()
k = 0
if N == 1:
    print(0)
else:
    for i in range(N-1):
        if H_list[i] <= H_list[i + 1]:
            k += 1
            A_list.append(k)
        else:
            k = 0
            A_list.append(k)
    if len(A_list) == 0:
        print(k)
    else:
        print(max(A_list))


Failing test case input:
7
20 7 0 0 3 -2 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H_list = list(map(int, input().split()))
A_list = []
H_list.reverse()
k = 0
if N == 1:
    print(0)
else:
    for i in range(N-1):
        if H_list[i] <= H_list[i + 1]:
            k += 1
            A_list.append(k)
        else:
            k = 0
            A_list.append(k)
    if len(A_list) == 0:
        print(k)
    else:
        print(max(A_list))
Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

n=int(input())
h=list(map(int,input().split()))
now=-1;maxnum=0;
for i in range(n+1):
    if i==0:
        now+=1;
    elif h[n-i-1]>=h[n-i]:
        now+=1
    else:
        maxnum=max(maxnum,now)
        now=0
print(max(maxnum,now))


Failing test case input:
4
-1 -1 2 18

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
import math

n=int(input())
h=list(map(int,input().split()))
now=-1;maxnum=0;
for i in range(n):
    if i==0:
        now+=1;
    elif h[n-i-1]>=h[n-i]:
        now+=1
    else:
        maxnum=max(maxnum,now)
        now=0
print(max(maxnum,now))

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

ans=0
posi=0
counter=0
while posi<N-1:
  if H[posi]>=H[posi+1]:
    counter+=1
    posi+=1
  else:
    if counter>ans:
      ans=counter
      
    counter=0
    posi+=1

if counter>ans:
  ans=counter
  
print(int(counter))

Failing test case input:
7
20 7 0 0 3 -1 2

Expected output:
3


Actual output:
0


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

ans=0
posi=0
counter=0
while posi<N-1:
  if H[posi]>=H[posi+1]:
    counter+=1
    posi+=1
  else:
    if counter>ans:
      ans=counter
      
    counter=0
    posi+=1

if counter>ans:
  ans=counter
  
print(int(ans))

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

N=int(input())
H=list(map(int,input().split()))
H.append(int(1e9+1))
cnt=0
ans=0
for i in range(N):
    if H[i]>=H[i+1]:
        cnt+=1
    else:
        ans=cnt
        cnt=0
print(cnt)

Failing test case input:
4
-2 2 4 0

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):

N=int(input())
H=list(map(int,input().split()))
H.append(int(1e11))
cnt=0
ans=0
for i in range(N):
    if H[i]>=H[i+1]:
        cnt+=1
    else:
        if cnt>ans:
            ans=cnt
        cnt=0
print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in reversed(range(1,len(h))):
  if i == 1 :
    ans = max(ans,cnt)
  elif h[i-1] >= h[i] :
    cnt +=1
  else:
    ans = max(ans,cnt)
    cnt = 0

print(ans)

Failing test case input:
4
-1 -1 0 10

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int,input().split()))
cnt = 0
ans = 0
for i in reversed(range(1,len(h))):
  if h[i-1] >= h[i] :
    cnt +=1
  else:
    ans = max(ans,cnt)
    cnt = 0
  if i == 1 :
    ans = max(ans,cnt)
  
print(ans)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def main(H):
    b = H[0]
    count = 0
    max_count = 0

    for i in range(1, len(H)):
        if H[i] > b:
            if max_count < count:
                max_count = count

            count = 0
        else:
            count += 1
        b = H[i]

    return max_count


if __name__ == "__main__":
    n = int(input())
    H = list(map(int, input().split()))
    print(main(H))


Failing test case input:
7
7 5 3 6 6 5 5

Expected output:
3


Actual output:
2


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


def main(H):
    b = H[0]
    count = 0
    max_count = 0

    for i in range(1, len(H)):
        if H[i] > b:
            if max_count < count:
                max_count = count

            count = 0
        else:
            count += 1
        b = H[i]

    return max(max_count, count)


if __name__ == "__main__":
    n = int(input())
    H = list(map(int, input().split()))
    print(main(H))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
h = [int(x) for x in input().split()]
max = 0
step = 0
for i in range(N-1):
    if h[i] > h[i+1]:
        step+=1
        if i == N-2:
         if step > max:
              max = step

    else:
        if step > max:
            max = step
        step=0
print(max)

Failing test case input:
7
7 3 8 6 6 5 8

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
h = [int(x) for x in input().split()]
max = 0
step = 0
for i in range(N-1):
    if h[i] >= h[i+1]:
        step+=1
        if i == N-2:
            if step > max:
                max = step

    else:
        if step > max:
            max = step
        step=0
print(max)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import os, sys, re, math

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

ups = [0]
for i in range(N - 1):
    if H[i] < H[i + 1]:
        ups.append(i)
ups.append(N - 1)

p = 0
max_d = 0
max_p = 0
for i in range(len(ups)):
    if ups[i] - p > max_d:
        max_d = ups[i] - p
        max_p = p
    p = ups[i] + 1

print(max_p)


Failing test case input:
5
10 4 8 13 3

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
import os, sys, re, math

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

ups = []
for i in range(N - 1):
    if H[i] < H[i + 1]:
        ups.append(i)
ups.append(N - 1)

p = 0
max_d = 0
max_p = 0
for i in range(len(ups)):
    if ups[i] - p > max_d:
        max_d = ups[i] - p
        max_p = p
    p = ups[i] + 1

print(max_d)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
ans = 0
count = 0
for i in range(N-1):
    if A[i]>=A[i+1]:
        count += 1
    else:
        ans = max(ans,count)
        count = 0
print(ans)

Failing test case input:
5
1 7 15 3 3

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
ans = 0
count = 0
for i in range(N-1):
    if A[i]>=A[i+1]:
        count += 1
    else:
        ans = max(ans,count)
        count = 0
ans = max(ans,count)
print(ans)

Problem: p02923
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
h = [int(xi) for xi in input().split()]

step = 0
mstep = 0
for xi in range(n-1):
    if h[xi]>=h[xi+1]:
        step +=1
    else:
        if mstep<step:
            mstep = step
            step = 0

if mstep<step:
    mstep = step-1

print(mstep)


Failing test case input:
5
12 5 13 4 3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
h = [int(xi) for xi in input().split()]

step = 0
mstep = 0
for xi in range(n-1):
    if h[xi] >= h[xi+1]:
        step += 1
    else:
        if mstep<step:
            mstep = step
        step = 0

if mstep<step:
    mstep = step

print(mstep)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
val = 0
ans = 0
H.reverse()

print(H)
for i in range(1,N):
    if H[i-1] <= H[i]:
        val += 1
    else:
        val = 0
    ans = max(ans, val)

print(ans)

Failing test case input:
7
7 5 3 6 6 5 5

Expected output:
3


Actual output:
[5, 5, 6, 6, 3, 5, 7]
3


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
val = 0
ans = 0
H.reverse()

for i in range(1,N):
    if H[i-1] <= H[i]:
        val += 1
    else:
        val = 0
    ans = max(ans, val)

print(ans)

Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
startpt=0
indexer=0
maxi=0
i=1
while(i<n):
    if(a[i]>a[i-1]):
        startpt=i
        maxi=max(i-startpt-1,maxi)
    i+=1
maxi=max(i-startpt-1,maxi)
print(maxi)

Failing test case input:
7
20 7 0 0 3 -1 2

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
startpt=0
indexer=0
maxi=0
i=1
while(i<n):
    if(a[i]>a[i-1]):
        maxi=max(i-startpt-1,maxi)
        startpt=i
        
    i+=1
maxi=max(i-startpt-1,maxi)
print(maxi)
Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))

tmp = -1
min = 0
for i in range(N-1):
    if H[i+1] - H[i] > 0:
        tmp = 0
    else:
        tmp -= 1

    if tmp < min:
        min = tmp

print(-min)

Failing test case input:
7
20 7 0 1 3 -2 2

Expected output:
2


Actual output:
3


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

tmp = 0
min = 0
for i in range(N-1):
    if H[i+1] - H[i] > 0:
        tmp = 0
    else:
        tmp -= 1

    if tmp < min:
        min = tmp

    
    

print(-min)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
res = 0
prv = a[0]
tmp = 0
for i in a[1:]:
    if i <= prv:
        prv = i
        tmp += 1
    else:
        tmp = 0
        prv = i
        res = max(res, tmp)
res = max(res, tmp)
print(res)

Failing test case input:
5
2 8 46 3 6

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split())) + [10 ** 10]
piv = 0
res = 0
tmp = 0
while piv < n:
    if a[piv] >= a[piv + 1]:
        tmp += 1
    else:
        res = max(res, tmp)
        tmp = 0
    piv += 1
else:
    res = max(res, tmp)
print(res)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
len_arr = int(input())
arr = [int(x) for x in input().split(' ')]

max_len = 0
current = 0
cont = 0

for height in arr:
    if current >= height:
        cont += 1
    else:
        cont = 1
    max_len = max(max_len, cont)
    current = height

print(cont-1)
exit(0)


Failing test case input:
7
20 7 0 1 3 -2 2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
len_arr = int(input())
arr = [int(x) for x in input().split(' ')]

diffs = [arr[i] - arr[i+1] for i in range(0, len_arr-1)]


cont = 0
max_len = 0
for d in diffs:
    if d >= 0:
        cont += 1
    else:
        max_len = max(max_len, cont)
        cont = 0
else:
    max_len = max(max_len, cont)

print(max_len)
exit(0)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
inf=10*9+7
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*n
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        length[i+1]=1
for i in range(n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
if len(cnt)==0:
    if length==[0]*n:
        print(n-1)
    else:
        print(0)
elif cnt==[1]+[0]*(n-2):
    print(0)
else:
    print(max(cnt))

Failing test case input:
5
10 4 8 13 3

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
inf=10*100
h=list(map(int,input().split()))+[inf]
n=len(h)
length=[0]*(n-1)+[1]
cnt=[]
move=0
for i in range(n-1):
    if h[i]<h[i+1]:
        length[i+1]=1
        if i==0:
            length[i]=1
for i in range(1,n):
    if length[i]==0:
        move+=1
    else:
        cnt.append(move)
        move=0
if len(cnt)==0:
    print(n-2)
else:
    print(max(cnt))
Problem: p02923
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
 
ans = 0
m=0
for i in range(N-1):
  if H[i] > H[i+1]:
    m+=1
    ans = max(ans, m)
    
  else:
    ans = max(ans, m)
    m=0
    
print(ans)

Failing test case input:
7
7 5 3 6 6 5 5

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
 
ans = 0
m=0
for i in range(N-1):
  if H[i] >= H[i+1]:
    m+=1
    ans = max(ans, m)
    
  else:
    ans = max(ans, m)
    m=0
    
print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
h=list(map(int,input().split()))
s=0
a=0
for i in range(len(h)-1):
    if h[i]>h[i+1]:
        a+=1
        if (s<a):
            s=a
    else:
        a=0
print(s)

Failing test case input:
4
-1 -1 2 18

Expected output:
1


Actual output:
0


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

    else:
        cnt=0

print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
h=list(map(int, input().split()))
cnt=0
ans=0

for i in range(N-1):
    if h[i]>=h[i+1]:
        cnt+=1
    else:
        if cnt>=ans:
            ans=cnt
        cnt=0

print(cnt)

Failing test case input:
7
64 3 1 4 -1 -2 5

Expected output:
2


Actual output:
0


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

Problem: p02923
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
h = list(map(int, input().split()))

step = 0

for i in range(n - 1):
    if h[i] >= h[i + 1]:
        step += 1
    else:
        step = 0

print(step)




Failing test case input:
7
64 7 0 1 0 -2 3

Expected output:
2


Actual output:
0


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

step = 0
max_num = 0
for i in range(n - 1):
    if h[i] >= h[i + 1]:
        step += 1
        max_num = max(step, max_num)
    else:
        step = 0
        

print(max_num)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
h = list(map(int, input().split()))
cnt = 0
score = 0
lower = 0
for i in range(n-1):
    if h[i] < h[i + 1]:
        score = max(score, cnt)
        cnt = 0
    else:
        cnt += 1
print(score)

Failing test case input:
4
-1 0 2 1

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
h = list(map(int, input().split()))
cnt = 0
score = 0
lower = 0
for i in range(n-1):
    if h[i] < h[i + 1]:
        score = max(score, cnt)
        cnt = 0
    else:
        cnt += 1
score = max(score, cnt)
print(score)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = [0] * N
for i, h in enumerate(input().split()):
  H[i] = int(h)
  
max_n = 0
n = 0
for i in range(N-1):
  if H[i] > H[i+1]:
    if max_n < n:
      max_n = n
    n = 0
  else:
    n += 1

print(max_n)

Failing test case input:
5
2 7 12 4 6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
H = [0] * N
for i, h in enumerate(input().split()):
  H[i] = int(h)
  
max_n = 0
n = 0

for i in range(N-1):
  if H[i] < H[i+1]:
    if max_n < n:
      max_n = n
    n = 0
  else:
    n += 1
if max_n < n:
  max_n = n
print(max_n)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
Hs = list(map(int, input().split()))
res = [0] * N

for index, h in enumerate(Hs):
    l = 0
    if index > 0:
        l = max(res[index - 1] - 1, 0)

    tmp = h
    while index + l + 1 < N and tmp >= Hs[index + l + 1]:
        tmp = Hs[index + l + 1]
        l += 1
    res[index] = l

print(max(res))

Failing test case input:
7
64 7 0 4 0 -2 5

Expected output:
2


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
Hs = list(map(int, input().split()))
res = [0] * N

for index, h in enumerate(Hs):
    l = 0
    if index > 0:
        l = max(res[index - 1] - 3, 0)

    tmp = h
    while index + l + 1 < N and tmp >= Hs[index + l + 1]:
        tmp = Hs[index + l + 1]
        l += 1
    res[index] = l

print(max(res))

Problem: p02923
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
h= list(map(int,input().split()))
n=len(h)
res=[0]*n
for i in range(n-1):
  j=i+1
  while j<=n-1:
    if h[i]>=h[j]:
      res[i]+=1
      j+=1
    else:
      break
print(max(res))

Failing test case input:
7
7 4 3 0 6 5 5

Expected output:
3


Actual output:
6


Fixed submission (verdict: Accepted):
n=int(input())
h= list(map(int,input().split()))
res=[0]*n
for i in range(1,n):
  if h[-i]<=h[-i-1]:
    res[i]=res[i-1]+1
  else:
    res[i]=0
print(max(res))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = [int(x) for x in input().split()]
x = 0
ans = 1

for i in range(1,len(H)):
    if H[i] <= H[i-1]:
        x += 1
        if x > ans:
            ans = x
    else:
        x = 0
print(ans)

Failing test case input:
4
-1 0 2 18

Expected output:
0


Actual output:
1


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

for i in range(1,len(H)):
    if H[i] <= H[i-1]:
        x += 1
        if x > ans:
            ans = x
    else:
        x = 0
print(ans)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))

ans = 1000000000
tmp = 0

for i in range(1, N):
    if H[i - 1] >= H[i]:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

ans = min(ans, tmp)

print(ans)


Failing test case input:
4
0 4 0 10

Expected output:
1


Actual output:
0


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

ans = 0
tmp = 0

for i in range(1, N):
    if H[i - 1] >= H[i]:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

ans = max(ans, tmp)

print(ans)

Problem: p02923
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
H = inintl()

H = H[::-1]
ans = 0
cnt = 0
prev = H[0]

for i in range(1,n):
    if H[i] >= prev:
        cnt += 1
        prev = H[i]
    else:
        if cnt > ans:
            ans = cnt
            cnt = 0
            prev = H[i]

print(ans)


Failing test case input:
7
20 7 3 0 3 0 2

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
H = inintl()

ans = 0
cnt = 0
prev = H[0]

for i in range(1,n):
    if H[i] <= prev:
        cnt += 1
        prev = H[i]
    else:
        if cnt > ans:
            ans = cnt
        cnt = 0
        prev = H[i]

if cnt > ans:
    ans = cnt

print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
l1=[0]
l1=l1*n
for i in range(n-2,0,-1):
    if(l[i]>=l[i+1]):
        l1[i]=l1[i+1]+1
print(max(l1))

Failing test case input:
7
20 7 3 0 3 -1 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
l1=[0]
l1=l1*n
for i in range(n-2,-1,-1):
    if(l[i]>=l[i+1]):
        l1[i]=l1[i+1]+1
print(max(l1))

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

H = str(input())
ans = 0
a = H[0]
index = 0

counter = 0
for i in range(N-1):
    
    index += 2
    b = H[index]
    
    if a>=b:
        counter +=1
    else:
        ans = max(ans,counter)
        counter = 0
    a = b
ans = max(ans,counter)
print(ans)




Failing test case input:
5
2 8 46 4 6

Expected output:
1


Actual output:
3


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

H = list(map(int,input().split()))
ans = 0
a = H[0]
index = 0

counter = 0
for i in range(N-1):
    
    b = int(H[i + 1])
    
    if a>=b:
        counter +=1
    else:
        ans = max(ans,counter)
        counter = 0
    a = b
ans = max(ans,counter)
print(ans)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
elements = list(map(int, input().split()))

newList = [0]
prev = elements[0]

for i in range(1,len(elements)):
  if prev<elements[i]:
    newList.append(0)
  else:
    newList.append(1)
  prev = elements[i]
print(newList)
count = 0

prev = 1
for i in range(1, len(newList)):
  if newList[i] == 0:
      count = 0
  elif newList[i] == 1:
      if prev == 1:
          count += 1
print(count)

Failing test case input:
4
-2 2 4 0

Expected output:
1


Actual output:
[0, 0, 0, 1]
1


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

newList = [0]
prev = elements[0]

for i in range(1,len(elements)):
  if prev<elements[i]:
    newList.append(0)
  else:
    newList.append(1)
  prev = elements[i]
count = 0

maxCount = 0
prev = 1
for i in range(1, len(newList)):
  if newList[i] == 0:
    count = 0
  elif newList[i] == 1:
      if prev == 1:
          count += 1
  maxCount = max(maxCount, count)
print(maxCount)

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

i=c=maxc=0

while i < len(l):
    if c > maxc:
        maxc=c
        ans=i
    i=i+c+1
    c=0
    for j in range(i+1,len(l)):
        if l[i]>=l[j]:
            c+=1
        else:
          break
          
print(maxc)


Failing test case input:
5
6 7 7 1 3

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
i=-1
c=maxc=0

while i < n:
    if c > maxc:
        maxc=c
        ans=i
    i=i+c+1
    c=0
    for j in range(i+1,n):
        if l[j-1]>=l[j]:
            c+=1
        else:
        	break

print(maxc)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
step=0
for i in range(N):
    if i+1<=N-1:
        if H[i+1]<=H[i]:
            step +=1
        else:
            step=0
    elif i+1>N-1:
        print(step)


Failing test case input:
7
10 4 3 0 3 0 2

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
step=0
max_step=0
for i in range(N):
    if i+1<=N-1:
        if H[i+1]<=H[i]:
            step +=1
        else:
            if step>max_step:
                max_step=step
            step=0
    elif i+1>N-1:
        if step>max_step:
            max_step=step
        print(max_step)
Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


n=int(input())


h = [int(i) for i in input().split()]
ans=0
l=[]
for i in range(n):
    if h[i]>h[i-1]:
        l.append(ans)
        ans=0
    elif h[i]<=h[i-1]:
        ans+=1
l.append(ans)
print(l)
print(max(l))

Failing test case input:
5
10 7 7 1 3

Expected output:
3


Actual output:
[0, 3, 0]
3


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


n=int(input())


h = [int(i) for i in input().split()]
ans=0
l=[]
for i in range(n):
    if h[i]>h[i-1]:
        l.append(ans)
        ans=0
    elif h[i]<=h[i-1]:
        ans+=1
    if i ==0:
        ans=0
l.append(ans)
print(max(l))

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
walk = 0
key = 0
temp = 0
while key < N-1:
    t_key = key
    while True:
        if key == N-1:
            break
        elif H[t_key] < H[key+1]:
            key += 1
            break
        else:
            temp += 1
            key += 1
    if temp > walk:
        walk = temp
    temp = 0
print(walk)

Failing test case input:
7
64 7 0 2 0 -2 5

Expected output:
2


Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
walk = 0
key = 0
temp = 0
while key < N-1:
    while True:
        if key == N-1:
            break
        elif H[key] < H[key+1]:
            key += 1
            break
        else:
            temp += 1
            key += 1
    if temp > walk:
        walk = temp
    temp = 0
print(walk)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
ans = 0
curr = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    curr += 1
  else:
    ans = max(ans, curr)
    curr = 0
else:
  ans = curr
  
print(ans)

Failing test case input:
5
10 7 7 1 3

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
H = list(map(int, input().split()))
ans = 0
curr = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    curr += 1
  else:
    ans = max(ans, curr)
    curr = 0
else:
  ans = max(ans, curr)
  
print(ans)

Problem: p02923
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
H=list(map(int,input().split()))
ans=[0]
for i in range(1,n):
  if H[i]-H[i-1]>=0:
    ans.append(ans[-1])
  else:
    ans.append(0)
print(max(ans))

Failing test case input:
5
6 7 7 1 3

Expected output:
2


Actual output:
0


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