input
stringlengths
20
127k
target
stringlengths
20
119k
problem_id
stringlengths
6
6
n = int(eval(input())) h = list(map(int,input().split())) count = [0]*(n-1) j = 0 count2 = [0]*(n-2) for i in range(n-1): if h[i] > h[i+1]: count[i] = 1 if h[i] < h[i+1]: count[i] = 0 if h[i] == h[i+1]: count[i] = 1 # print(count) z = 0 for i in range(n-2): i...
n = int(eval(input())) h = list(map(int,input().split())) count = 0 ans = 0 h.reverse() for i in range(n-1): if h[i]<=h[i+1]: count += 1 else: count = 0 ans = max(ans,count) print(ans)
p02923
N = int(eval(input())) high = [int(x) for x in input().split()] top = 0 for i in range(N): challenge = True count = 0 while challenge == True and i < N-1: if high[i] >= high[i+1]: count += 1 if i < N-1: i += 1 else: challe...
N = int(eval(input())) high = [int(x) for x in input().split()] top = 0 count = 0 for i in range(N): challenge = True if count > 0: count -= 1 else: while challenge == True and i < N-1: if high[i] >= high[i+1]: count += 1 if i...
p02923
n=int(eval(input())) h= list(map(int,input().split())) res=[0]*n for i in range(n-1): j=i+1 while j<=n-1: if h[i]>=h[j]: res[i]+=1 i+=1 j+=1 else: break print((max(res)))
n=int(eval(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)))
p02923
n=int(eval(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)))
n=int(eval(input())) h= list(map(int,input().split())) left=ans=0 for right in range(1,n-1): if h[right]>=h[right+1]: ans=max(ans,right-left+1) else: left=right+1 print(ans)
p02923
n=int(eval(input())) h=list(map(int,input().split()))+[10**9+1] ans=0 cnt=0 for i in range(1,n+1): if h[i-1]>=h[i]: cnt+=1 else: ans=max(ans,cnt) cnt=0 print(ans)
n=int(eval(input())) h=list(map(int,input().split())) ans=0 t_ans=0 b_h=h[0] for i in h[1:]: if b_h>=i: t_ans+=1 else: ans=max(ans,t_ans) t_ans=0 b_h=i ans=max(ans,t_ans) print(ans)
p02923
from sys import stdin nii=lambda:list(map(int,stdin.readline().split())) lnii=lambda:list(map(int,stdin.readline().split())) n=int(eval(input())) h=lnii() ans=0 t_ans=0 for i in range(n-1): if h[i]>=h[i+1]: t_ans+=1 else: ans=max(ans,t_ans) t_ans=0 print((max(ans,t_ans)))
from sys import stdin nii=lambda:list(map(int,stdin.readline().split())) lnii=lambda:list(map(int,stdin.readline().split())) n=int(eval(input())) h=lnii()+[10**10] ans=0 t_ans=0 for i in range(n): if h[i]>=h[i+1]: t_ans+=1 else: ans=max(ans,t_ans) t_ans=0 print(ans)
p02923
N=int(eval(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)))
N=int(eval(input())) H=list(map(int, input().split())) a=[0]*N for i in range(1, N): if H[i-1]>=H[i]: a[i]=a[i-1]+1 print((max(a)))
p02923
N = int(eval(input())) H = [int(x) for x in input().split()] count = [] current_count = 0 for x in range(N - 1): if H[x] >= H[x + 1]: current_count += 1 else: count.append(current_count) current_count = 0 count.append(current_count) print((max(count)))
import sys sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): N = int(eval(input())) H = [int(x) for x in input().split()] cnt = 0 prev = H[0] ans = 0 for i in range(1, N): if prev >= H[i]: cnt += 1 else: ans = max...
p02923
n = int(eval(input())) h = list(map(int, input().split())) a = [] for i in range(n): ans = 0 for j in range(i+1, n): if h[j-1]>=h[j]: ans+=1 else: break a.append(ans) ans = 0 a.sort(reverse=True) print((a[0]))
n = int(eval(input())) h = list(map(int, input().split())) a = [0] ans = 0 for i in range(1,n): if h[i-1]>=h[i]: ans+=1 else: a.append(ans) ans=0 if i==n-1: a.append(ans) a.sort(reverse=True) print((a[0]))
p02923
#Lower N = int(eval(input())) H = list(map(int, input().split())) max = 0 n=0 for i in range(N-1): if H[i] >= H[i+1]: n = n+1 else : n = 0 if n > max: max = n print(max)
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 ctr = 0 for i in range(N-1): if H[i] >= H[i+1]: ctr += 1 else: ctr = 0 ans = max(ans, ctr) print(ans)
p02923
n = int(eval(input())) h = list(map(int,input().split())) count = [0]*n for i in range(n): # print("i is", i,"=======") for j in range(i, n-1): # print("h[j] is", h[j]) # print("h[j+1] is", h[j+1]) if h[j] >= h[j + 1]: count[i] += 1 # print("count is",count) else: break...
n = int(eval(input())) h = list(map(int, input().split())) t = 0 result = 0 for i in range(n - 1): if h[i + 1] <= h[i]: t += 1 else: result = max(t, result) t = 0 result = max(t, result) print(result)
p02923
N = int(eval(input())) H = list(map(int,input().split())) maximum = 0 cnt = 0 for i in range(len(H)): k = H[i] res = H[i+1:] for j in res: if(j <= k): cnt += 1 k = j else: break maximum = max(maximum,cnt) #if(max < cnt): ...
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 tmp = 0 for i in range(N-1): if(H[i] < H[i+1]): #ans = max(ans,tmp) tmp = 0 else: tmp += 1 ans = max(ans,tmp) print(ans)
p02923
n = int(eval(input())) H = list(map(int, input().split())) ans = 0 for i in range(n): if ans >= n-i-1: break tmp = 0 for j in range(i, n-1): if H[j] >= H[j+1]: tmp += 1 else: break ans = max(ans, tmp) print(ans)
n = int(eval(input())) H = list(map(int, input().split())) TMP = [] ans = 0 for i in range(n-1): if H[i] >= H[i+1]: TMP.append(1) else: TMP.append(-1) tmp = 0 for i in range(n-1): if TMP[i] == 1: tmp += 1 else: ans = max(ans, tmp) tmp = 0 ans = max(ans, tmp) print(ans)
p02923
n,*l=list(map(int,open(0).read().split())) c=p=m=0 for i in l: c=(c+1)*(i<=p) m=max(m,c) p=i print(m)
n,*l=list(map(int,open(0).read().split())) c=p=m=0 for i in l: c=-~c*(i<=p); m=max(m,c); p=i print(m)
p02923
import sys N = int(eval(input())) H = list(map(int,input().split())) max = 0 for i in range(N): count = 0 for j in range(i+1,N): #print('i',i,' j',j,' H[j-1]', H[j-1], ' H[j]', H[j]) if(H[j-1] >= H[j]): count = count+1 if(count > max): max = count ...
import sys N = int(eval(input())) H = list(map(int,input().split())) max = 0 count = 0 for i in range(N-1): if(H[i] >= H[i+1]): count = count+1 if(max < count): max = count else: count = 0 print(max)
p02923
full_num = int(eval(input())) A = list(map(int, input().split())) move = 0 A_result = "" for i in range(full_num-1): if A[i] >= A[i+1]: A_result =A_result+"1" else: A_result =A_result+"0" B = list(A_result.split("0")) C = [] for i in B: C.append(len(i)) print((max(C)))
n = int(eval(input())) h = list(map(int, input().split())) cnt =0 m =[] if n !=1: for i in range(n - 1): if h[i] >= h[i + 1]: cnt += 1 if i == n - 2: m.append(cnt) else: m.append(cnt) cnt = 0 else: m.append(0) print((max(m)))
p02923
N = int(eval(input())) H = list(map(int, input().split())) a = [0] * N for i in range(N): for j in range(i, N-1): if H[j] >= H[j+1]: a[i] = a[i] + 1 else: break print((max(a)))
N = int(eval(input())) H = list(map(int, input().split())) a = [0] * N start = 0 for i in range(N - 1): if H[i] >= H[i+1]: a[start] += 1 else: start += 1 print((max(a)))
p02923
n = int(eval(input())) hn =list(map(int, input().split())) ls= [0]*(n-1) ans = 0 count = 0 for i in range(n-1): if hn[i+1] <= hn[i]: ls[i] = 1 count += 1 else: ans = max(ans, count) count=0 ans = max(ans, count) print(ans)
n = int(eval(input())) hn =list(map(int, input().split())) ans = 0 count = 0 for i in range(n-1): if hn[i+1] <= hn[i]: count += 1 else: ans = max(ans, count) count=0 ans = max(ans, count) print(ans)
p02923
N = int(eval(input())) arr = list(map(int, input().split())) ans =0 for i in range(N-1): count =0 for j in range(i,N-1,1): if arr[j] >= arr[j+1]: count +=1 else: break if count>ans: ans =count print(ans)
N = int(eval(input())) arr = list(map(int, input().split())) jump_flg = [0]*N for i in range(N-1): if arr[i] >= arr[i+1]: jump_flg[i] =1 ans = 0 count = 0 for i in range(N): if jump_flg[i] == 1: count +=1 if ans<count: ans =count else: count =0 ...
p02923
N = int(eval(input())) H = list(map(int,input().split())) c = 0 max_c = 0 for i in range(N-1): for j in range(i+1,N): if H[i] < H[j]: break else: c += 1 i += 1 if max_c < c: max_c = c c = 0 print(max_c)
N = int(eval(input())) H = list(map(int,input().split())) c = 0 max_c = 0 i = 0 while i < N-1: j = i+1 while j < N: if H[i] < H[j]: i = j break else: c += 1 j += 1 i += 1 if max_c < c: max_c = c c ...
p02923
n = int(eval(input())) h = list(map(int,input().split())) ans = cnt = 0 for i in range(1,n): flag = cnt = 0 for j in range(i,n): if h[j-1]>=h[j] and flag==0: cnt+=1 else: flag = 1 ans = max(ans,cnt) print(ans)
n = int(eval(input())) h = list(map(int,input().split())) dif = [0]*(n-1) ans = cnt = 0 for i in range(n-1): dif[i] = h[i]-h[i+1] for i in dif: if i>=0: cnt+=1 else: ans = max(ans,cnt) cnt=0 print((max(ans,cnt)))
p02923
n = int(eval(input())) count = 0 max_count = 0 pre_height = -1 for height in list(map(int, input().split())): if (pre_height < height): if (max_count < count): max_count = count count = 0 pre_height = height continue count += 1 pre_...
n = int(eval(input())) h_list = list(map(int, input().split())) count = 0 max_count = 0 pre_height = -1 for height in h_list: if (pre_height < height): if (max_count < count): max_count = count count = 0 pre_height = height continue cou...
p02923
n = int(eval(input())) h = list(map(int, input().split())) max1 = 0 for i in range(n): now = i try1 = 0 for l in range(n - i - 1): if h[now] >= h[now + 1]: now += 1 try1 += 1 else: if try1 > max1: max1 = try1 br...
n = int(eval(input())) h = list(map(int, input().split())) max1 = 0 count = 0 for i in range(n-1): if h[i] >= h[i+1]: count += 1 else: count = 0 if count > max1: max1 += 1 print(max1)
p02923
import sys INPUT = lambda: sys.stdin.readline().rstrip() INT = lambda: int(INPUT()) LIST = lambda: list(map(int, INPUT().split())) sys.setrecursionlimit(10 ** 9) def main(): N = INT() H = LIST() D = "" for i in range(N-1): if H[i] >= H[i+1]: D += "o" else: D += "x" ...
import sys INPUT = lambda: sys.stdin.readline().rstrip() INT = lambda: int(INPUT()) LIST = lambda: list(map(int, INPUT().split())) sys.setrecursionlimit(10 ** 9) def main(): N = INT() H = LIST() D = [0] idx = 0 for i in range(N-1): if H[i] >= H[i+1]: D[idx] += 1 els...
p02923
n=int(eval(input())) mas=list(map(int,input().split())) out=[] mx=0 for i in range(n): if mx>n-i: break j=i ans=0 while j<n-1: if mas[j]>=mas[j+1]: ans+=1 else: break j+=1 if ans>mx: mx=ans print(mx)
n=int(eval(input())) mas=list(map(int,input().split())) out=[] mx=0 i=0 while i<n: if mx>n-i: break j=i ans=0 while j<n-1: if mas[j]>=mas[j+1]: ans+=1 else: break j+=1 if ans>mx: mx=ans i+=ans+1 print(mx)
p02923
n = int(eval(input())) h = list(map(int, input().split())) import heapq heap = [] for i in range(n): m = 0 for j in range(i,n-1): if h[j] >= h[j+1]: m += 1 else: break heapq.heappush(heap, -m) print((-heapq.heappop(heap)))
n = int(eval(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)))
p02923
n = int(eval(input())) h = list(map(int, input().split())) kari = 0 honto = 0 for i in range(n-1): kari = 0 for j in range(i,n-1): if h[j+1] <= h[j]: kari += 1 else: break if honto < kari: honto = kari print(honto)
n = int(eval(input())) l = list(map(int, input().split())) kari = 0 p = 0 for i in range(n-1): if l[i+1] <= l[i]: kari += 1 if kari > p: p = kari else: if kari > p: p = kari kari = 0 print(p)
p02923
n = int(eval(input())) h = list(map(int, input().split())) a = 0 for i in range(n+1): c = 0 for j in range(n-i-1): if h[i:][j] >= h[i:][j+1]: c += 1 else: break if c > a: a = c print(a)
n = int(eval(input())) h = list(map(int, input().split())) c = 0 a = 0 for i in range(n-1): if h[i] >= h[i+1]: c += 1 else: a = max(c, a) c = 0 #最後のcはelseで引っかからない a = max(c, a) print(a)
p02923
n = int(eval(input())) h = list(map(int, input().split())) ans = 0 for i in range(n-1): s = h[i] t = 0 for j in range(i+1,n): if s >= h[j]: t += 1 s = h[j] else: ans = max(ans, t) break ans = max(ans, t) print(ans)
n = int(eval(input())) h = list(map(int, input().split())) ans = 0 t = 0 for i in range(n-1): if h[i] >= h[i+1]: t += 1 else: ans = max(ans, t) t = 0 continue ans = max(ans, t) print(ans)
p02923
n = int(eval(input())) h_list = list(map(int,input().split())) count = {} for i in range(len(h_list)-1): if h_list[i] >= h_list[i+1]: count[i] = 0 j = i while j < n-1: if h_list[j] >= h_list[j+1]: count[i] += 1 j += 1 else:...
n = int(eval(input())) h_list = list(map(int,input().split())) count = 0 bestcount = count for i in range(n-1): if h_list[i] >= h_list[i+1]: count += 1 else: bestcount = max(count,bestcount) count= 0 print((max(count,bestcount)))
p02923
n = int(eval(input())) h = list(map(int, input().split())) t = 0 result = 0 for i in range(n - 1): if h[i + 1] <= h[i]: t += 1 else: result = max(t, result) t = 0 result = max(t, result) print(result)
N = int(eval(input())) h = list(map(int, input().split())) res = 0 ans = 0 for i in range(N-1): if h[i] >= h[i+1]: res += 1 ans = max(ans, res) else: res = 0 print(ans)
p02923
N = int(eval(input())) H = list(map(int,input().split())) H.append(10**10) tmp = 0 for i in range(0,N-2): new_tmp = 0 j = i while H[j] >= H[j+1]: new_tmp += 1 j += 1 if new_tmp > tmp:tmp = new_tmp print(tmp)
N = int(eval(input())) H = list(map(int,input().split())) tmp = 0 new_tmp = 0 i = N-1 while i >= 1: if H[i] <= H[i-1]: new_tmp += 1 i -= 1 if new_tmp > tmp: tmp = new_tmp else: if new_tmp > tmp: tmp = new_tmp new_tmp = 0 i -=...
p02923
import itertools import math import string import collections from collections import Counter from collections import deque import sys sys.setrecursionlimit(2*10**5) INF = 2**60 def readints(): return list(map(int, input().split())) def nCr(n, r): return math.factorial(n)//(math.factorial(n-...
import math import string import collections from collections import Counter def readints(): return list(map(int, input().split())) def nCr(n, r): return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) def has_duplicates2(seq): seen = [] for item in seq: if not(...
p02923
N=int(eval(input())) H=list(map(int,input().split())) ans=0 for i in range(N-1): sum=0 while H[i]>=H[i+1]: sum += 1 i += 1 if i==N-1: break ans = max(ans,sum) print(ans)
N=int(eval(input())) H=list(map(int,input().split())) ans=0 sum=0 for i in range(N-1): if H[i]>=H[i+1]: sum += 1 else: sum = 0 ans = max(ans,sum) print(ans)
p02923
N=int(eval(input())) H=list(map(int,input().split())) max_ans=0 for i in range(len(H)): A=i ans=0 for j in range(i+1,len(H)): if H[A]>=H[j]: ans=ans+1 elif H[A]<H[j]: break A=A+1 max_ans=max(ans,max_ans) print(max_ans)
N=int(eval(input())) H=list(map(int,input().split())) max_ans=0 ans=0 for i in range(N-1): if H[i]>=H[i+1]: ans=ans+1 else: max_ans=max(ans,max_ans) ans=0 max_ans=max(ans,max_ans) print(max_ans)
p02923
N = int(eval(input())) H = list(map(int, input().split())) ans = 0 cnt = 0 for i in range(0, N-1): if H[i] >= H[i + 1]: cnt += 1 ans = max(cnt, ans) else: cnt = 0 print(ans)
n = int(eval(input())) H = list(map(int, input().split())) ans = 0 H_r = H[::-1] cnt = 0 for i in range(n - 1): now = H_r[i] nex = H_r[i + 1] if now <= nex: cnt += 1 ans = max(ans, cnt) else: cnt = 0 nex = now print(ans)
p02923
# 2019-11-17 20:44:23(JST) import sys # import collections # import math # from string import ascii_lowercase, ascii_uppercase, digits # from bisect import bisect_left as bi_l, bisect_right as bi_r # import itertools # from functools import reduce # import operator as op # import re # import heapq # import a...
import sys n, *H = list(map(int, sys.stdin.read().split())) def main(): res = 0 cnt = 0 prev = 0 for h in H + [float('inf')]: if h <= prev: cnt += 1 else: res = max(res, cnt) cnt = 0 prev = h return res if __name__ =...
p02923
import sys n, *H = list(map(int, sys.stdin.read().split())) def main(): res = 0 cnt = 0 prev = 0 for h in H + [float('inf')]: if h <= prev: cnt += 1 else: res = max(res, cnt) cnt = 0 prev = h return res if __name__ =...
import sys n, *h = list(map(int, sys.stdin.read().split())) h += [float('inf')] def main(): prev = res = cnt = 0 for x in h: if x > prev: res = max(res, cnt) cnt = 0 else: cnt += 1 prev = x print(res) if __name__ == '__main__': ...
p02923
N = int(eval(input())) H = list(map(int,input().split())) maxMove = 0 tempoMove = 0 for i in range(N): if N-len(list(range(i))) <= maxMove: break for j in range(N-i-1): if i < maxMove: break if H[i+j]>=H[i+j+1]: tempoMove = tempoMove + 1 else: break if tempoMove > m...
N = int(eval(input())) H = list(map(int,input().split())) maxMove = 0 tempoMove = 0 for i in range(N): if N-len(list(range(i))) <= maxMove: break if tempoMove > 0: tempoMove = tempoMove - 1 continue for j in range(N-i-1): if H[i+j]>=H[i+j+1]: tempoMove = tempoMove + 1 else: ...
p02923
N = int(eval(input())) H = [int(e) for e in input().split()] count_max = 0 for i in range(N): count = 0 for j in range(i,N-1): if H[j] >= H[j+1]: count += 1 else: i += j + 1 break; if count_max < count: count_max = count if count_max > N / 2: break; print(cou...
N = int(eval(input())) H = [int(e) for e in input().split()] count_max = 0 i = 0 while i < N: judge = True count = 0 tmp = i for j in range(tmp,N): if j < N-1: if H[j] >= H[j+1]: count += 1 else: break; #print(count) if count_max < count: count_max = cou...
p02923
N = int(eval(input())) numbers = [int(n) for n in input().split(' ')] distances = [] if N == 1: print((0)) else: counter = 0 for i in range(0, len(numbers)): if i == len(numbers) - 1: distances.append(counter) break if numbers[i] >= numbers[i + 1]: ...
N = int(eval(input())) numbers = [int(n) for n in input().split(' ')] distances = [] counter = 0 for i in range(0, len(numbers)): if i == len(numbers) - 1: distances.append(counter) break if numbers[i] >= numbers[i + 1]: counter += 1 else: distances.append(counter)...
p02923
N = int(eval(input())) H = list(map(int, input().split())) counter = -1 last_h = float('inf') _max = 0 for h in H: if h <= last_h: counter += 1 else: if _max < counter: _max = counter counter = 0 last_h = h if _max < counter: _max = counter print(_max...
def solve(N, H): last_h = float('inf') _count = -1 _max = 0 for h in H: if h <= last_h: _count += 1 else: if _max < _count: _max = _count _count = 0 last_h = h if _max < _count: _max = _count return...
p02923
n=int(eval(input())) h=list(map(int,input().split())) li=[0] for i in range(n-1): if not(h[i]<h[i+1]) and (i==0 or h[i-1]<h[i]): k=0 while i+k<n-1 and not(h[i+k]<h[i+k+1]): k+=1 li=li+[k] if sum(li)>n/2: break print((max(li)))
n=int(eval(input())) h=list(map(int,input().split())) li=[0] while len(h)>1: for i in range(len(h)): if i==len(h)-1: li += [len(h)-1] del h[1:] elif h[i]<h[i+1]: li += [len(h[0:i+1])-1] del h[0:i+1] break print((max(li)))
p02923
N = int(eval(input())) H = list(map(int,input().split())) s = 0 for i in range(N-1): num = i t = 0 while num < N - 1 and H[num] >= H[num + 1]: t += 1 num += 1 if s <= t: s = t print(s)
N = int(eval(input())) H = list(map(int,input().split())) s = 0 i = 0 while 0 <= i < N - 1: num = i t = 0 while num < N - 1 and H[num] >= H[num + 1]: t += 1 num += 1 if s <= t: s = t i = num + 1 print(s)
p02923
import copy n = int(eval(input())) r_L = list(map(int,input().split())) l_L = copy.deepcopy(r_L) l_L.reverse() r_ans,l_ans = 0,0 r_ans_L,l_ans_L = [],[] for val in range(n-1): if r_L[val] >= r_L[val+1]: r_ans += 1 else: r_ans_L.append(r_ans) r_ans = 0 l_ans...
n = int(eval(input())) h_L = list(map(int,input().split())) s = h_L[0] tmp = 0 result_L = [] for i in range(0,n-1): if s >= h_L[i+1]: tmp += 1 else: result_L.append(tmp) tmp = 0 s = h_L[i+1] result_L.append(tmp) print((max(result_L)))
p02923
N = int(eval(input())) Hs = list(map(int, input().split())) + [10**10] ans = 0 num = 0 for i in range(N): if Hs[i] >= Hs[i+1]: num += 1 else: ans = max(ans, num) num = 0 print(ans)
N = int(eval(input())) Hs = list(map(int, input().split())) ans = 0 num = 0 for i in range(N-1): if Hs[i] >= Hs[i+1]: num += 1 if num > ans: ans = num else: num = 0 print(ans)
p02923
def solve(inp): N = int(inp.readline().strip()) H = list(map(int, inp.readline().strip().split(' '))) r = 0 for i in range(N): r0 = 0 prev = H[i] for j in range(i + 1, N): if prev < H[j]: break r0 += 1 prev = H[j] ...
def solve(inp): N = int(inp.readline().strip()) H = list(map(int, inp.readline().strip().split(' '))) r = 0 i = 0 while i < N: r0 = 0 prev = H[i] j = i + 1 while j < N: if prev < H[j]: break r0 += 1 pr...
p02923
n = int(eval(input())) h = list(map(int, input().split())) y = 0 x = 0 for i in range(n-1): if x > y: y = x x = 0 for j in range(n-i-1): if h[i+j] >= h[i+j+1]: x += 1 else: break print(y)
n = int(eval(input())) h = list(map(int, input().split())) y = 0 x = 0 for i in range(n-1): if h[i] >= h[i+1]: x += 1 if x > y: y = x else: x = 0 print(y)
p02923
N = int(eval(input())) H = list(map(int, input().split())) a, b = 0, 0 for i in range(N-1): if H[i] >= H[i+1]: b += 1 else: b = 0 a = max(a, b) print(a)
N = int(eval(input())) H = list(map(int, input().split())) ans, b = 0, 0 for i in range(N-1): if H[i] >= H[i+1]: b += 1 else: ans = max(ans, b) b = 0 ans = max(ans, b) print(ans)
p02923
N = int(eval(input())) h = list(map(int, input().split())) h.append(1000000001) max_n = 0 for i in range(N-1): add = 0 count = 0 while h[i+add] >= h[i+add+1]: count += 1 add += 1 max_n = max(max_n, count) print(max_n)
N = int(eval(input())) h = list(map(int, input().split())) h.append(1000000001) max_n = 0 counter = 0 while counter < N-1: add = 0 count = 0 while h[counter+add] >= h[counter+add+1]: count += 1 add += 1 counter += add +1 max_n = max(max_n, count) print(max_n)
p02923
# -*- coding: utf-8 -*- # 整数の入力 n = int(eval(input())) h = list(map(int, input().split())) max_count = 0 for i in range(n): tmp_count = 0 for j in range(i+1, n): if h[j-1] >= h[j]: tmp_count += 1 else: break if max_count < tmp_count: max_count =...
# -*- coding: utf-8 -*- # 整数の入力 n = int(eval(input())) h = list(map(int, input().split())) max_count = 0 tmp_count = 0 for i in range(n-1): if h[i] >= h[i+1]: tmp_count += 1 else: if max_count < tmp_count: max_count = tmp_count tmp_count = 0 if max_count < tm...
p02923
number = int(eval(input())) lower = list(map(int, input().split())) time = 0 max = 0 def down(i): global time for j in range(i, number-1): if lower[j] >= lower[j+1]: time += 1 else: return for i in range(len(lower)): if max > (number-i+1): ...
number = int(eval(input())) lower = list(map(int, input().split())) time = 0 max = 0 def down(i): global time for j in range(i, number-1): if lower[j] >= lower[j+1]: time += 1 else: return j+1 return 0 now = 0 for i in range(len(lower)): if...
p02923
import sys, heapq def LI(): return list(map(int, sys.stdin.readline().split())) def LS(): return list(sys.stdin.readline()) N = int(eval(input())) H = LI() res = 0 cnt = 0 for i in range(N - 1): if H[i] < H[i + 1]: res = max(res, cnt) cnt = -1 cnt += 1 res = max(res, cnt) prin...
import sys, heapq def LI(): return list(map(int, sys.stdin.readline().split())) def LS(): return list(sys.stdin.readline()) N = int(eval(input())) H = list(map(int, input().split())) res = 0 cnt = 0 for i in range(N - 1): if H[i] < H[i + 1]: res = max(res, cnt) cnt = -1 cnt += 1 ...
p02923
n = int(eval(input())) h = list(map(int, input().split())) higher = [0] move = [0] for i in range(1, n): if h[i-1] < h[i]: m = i - higher[len(higher) - 1] - 1 move.append(m) higher.append(i) move.append(len(h) - 1 - higher[len(higher) - 1]) print((max(move)))
n = int(eval(input())) h = list(map(int, input().split())) move = [0] cnt = 0 for i in range(n-1): if h[i] >= h[i+1]: cnt += 1 if i == n-2: move.append(cnt) else: move.append(cnt) cnt = 0 print((max(move)))
p02923
n = int(eval(input())) hn = [int(i) for i in input().split()] max_cnt, cnt = 0, 0 for i in range(1, n): if hn[i - 1] - hn[i] >= 0: cnt += 1 else: cnt = 0 if max_cnt < cnt: max_cnt = cnt print(max_cnt)
n = int(eval(input())) h = [int(i) for i in input().split()] max_cnt, cnt = 0, 0 for i in range(n - 1): if h[i] >= h[i + 1]: cnt += 1 else: max_cnt = max(max_cnt, cnt) cnt = 0 print((max(max_cnt, cnt)))
p02923
n = int(eval(input())) h = [int(i) for i in input().split()] max_cnt, cnt = 0, 0 for i in range(n - 1): if h[i] >= h[i + 1]: cnt += 1 else: cnt = 0 max_cnt = max(max_cnt, cnt) print(max_cnt)
n = int(eval(input())) h = list(map(int, input().split())) max_cnt, cnt = 0, 0 for i in range(n - 1): if h[i] >= h[i + 1]: cnt += 1 else: cnt = 0 max_cnt = max(max_cnt, cnt) print(max_cnt)
p02923
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 for i in range(N): k = 0 for j in range(i+1,N): if H[j-1]>=H[j]: k+=1 else:break ans = max(ans,k) print(ans)
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 k = 0 for i in range(N-1): if H[i]>=H[i+1]: k+=1 else: ans = max(ans,k) k=0 print((max(ans,k)))
p02923
n=int(eval(input())) h=list(map(int,input().split())) h=h[::-1] dp=[0]*n for i in range(1,n): if h[i] >= h[i-1]: dp[i] = 1+dp[i-1] print((max(dp)))
n = int(eval(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(ans, cnt) cnt = 0 ans = max(ans, cnt) print(ans)
p02923
n = int(eval(input())) x = input().split() y = [0] c = 0 for i in range(n-1): if int(x[i]) >= int(x[i+1]): c = c + 1 else: y.append(c) c = 0 y.append(c) print((max(y)))
n = int(eval(input())) alturas = list(map(int, input().split())) if n == 1: print((0)) else: atual = 0 max_value = 0 contador = 0 while atual + 1 < n: if alturas[atual] >= alturas[atual+1]: contador += 1 else: max_value = max(contador, max_value) contador = 0 atual += 1 max_value =...
p02923
n = int(eval(input())) h = list(map(int,input().split())) count = [] for i in range(n): j = i count.append(0) while j < n -1 and h[j] >= h[j+1]: count[i] += 1 j += 1 print((max(count)))
n = int(eval(input())) h = list(map(int,input().split())) count = [0]*n i = 0 while i < n: j = i while j < n -1 and h[j] >= h[j+1]: count[i] += 1 j += 1 i += count[i] + 1 print((max(count)))
p02923
N = int(eval(input())) H = list(map(int, input().split())) ans = 0 for i in range(N - 1): now = 0 for j in range(i, N - 1): if H[j] >= H[j + 1]: now += 1 else: break ans = max(ans, now) print(ans)
N = int(eval(input())) H = list(map(int, input().split())) ans = 0 now = 0 for i in range(1, N): if H[i - 1] >= H[i]: now += 1 ans = max(ans, now) else: now = 0 print(ans)
p02923
def main(): n = int(eval(input())) h = input().split() h = [int(n) for n in h] max = 0 now = 0 i = 0 for i in range(n-1): now = 0 for j in range(i + 1, n): if h[j] <= h[j - 1]: now += 1 else: i = j - 1 ...
def main(): n = int(eval(input())) h = input().split() h = [int(n) for n in h] max = 0 now = 0 i = 0 for i in range(n-1): if h[i] >= h[i+1]: now += 1 else: if now >= max: max = now now=0 if now >= max: ...
p02923
def main(): n = int(eval(input())) h = input().split() h = [int(n) for n in h] max = 0 now = 0 i = 0 for i in range(n-1): if h[i] >= h[i+1]: now += 1 else: if now >= max: max = now now=0 if now >= max: ...
import sys input = sys.stdin.readline def main(): n = int(eval(input())) h = input().split() h = [int(n) for n in h] max = 0 now = 0 i = 0 for i in range(n-1): if h[i] >= h[i+1]: now += 1 else: if now >= max: max = now ...
p02923
n = int(eval(input())) h = list(map(int,input().split())) cnt = 0 for i in range(n-1): j = i cnt_ = 0 while h[j] >= h[j+1]: cnt_ += 1 j += 1 if j == n-1: break if cnt_ > cnt: cnt = cnt_ print(cnt)
n = int(eval(input())) h = list(map(int,input().split())) cnt = 0 cnt_ = 0 for i in range(n-1): if h[i] < h[i+1]: cnt_ = 0 else: cnt_ += 1 if cnt < cnt_: cnt = cnt_ print(cnt)
p02923
# import itertools from collections import Counter from collections import defaultdict from collections import deque import bisect from heapq import heappush, heappop def main(): n = int(eval(input())) hl = list(map(int, input().split())) counts = [0] * n for i in range(n-1,0,-1): ...
# import itertools from collections import Counter from collections import defaultdict from collections import deque import bisect from heapq import heappush, heappop def main(): n = int(eval(input())) hl = list(map(int, input().split())) counts = [0] * n for i in range(1,n): i...
p02923
n = int(eval(input())) h = [int(i) for i in input().split()] c = 0 m = 0 for i in range(n-1): if h[i] >= h[i+1]: if i == n - 1: c += 2 else: c += 1 m = max(c,m) else: c = 0 print(m)
n = int(eval(input())) h = [int(i) for i in input().split()] c = 0 m = 0 for i in range(n-1): if h[i] >= h[i+1]: c += 1 m = max(c,m) else: c = 0 print(m)
p02923
import sys sys.setrecursionlimit(1000000) n = int(eval(input())) lists = list(map(int,input().split())) res = [] def func(i, sum): if i == n-1: return sum if lists[i] < lists[i+1]: return sum return func(i+1, sum+1) for j in range(n): res.append(func(j, 0)) print((max(re...
import sys sys.setrecursionlimit(100000) n = int(eval(input())) high = list(map(int,input().split())) lists = [] def func(i,t): if i == n - 1: lists.append(t) return if high[i] < high[i+1]: lists.append(t) func(i+1,0) else: t += 1 func(i+1,t...
p02923
n=int(eval(input())) h=list(map(int,input().split())) h.append(float('inf')) ans=0 cnt=0 for i in range(n): c=h[i] for j in range(i+1,n+1): if c>=h[j]: cnt+=1 c=h[j] else: ans=max(ans,cnt) cnt=0 break print(ans)
n=int(eval(input())) h=list(map(int,input().split())) h.append(float('inf')) ans=0 cnt=0 for i in range(n): if h[i]>=h[i+1]: cnt+=1 else: ans=max(ans,cnt) cnt=0 ans=max(ans,cnt) print(ans)
p02923
n = int(eval(input())) h = list(map(int, input().split())) max = 0 for i in range(n-1): tmp = 0 j = i while h[j]>=h[j+1]: j += 1 tmp += 1 if j == n-1: break if tmp>max: max = tmp print(max)
n = int(eval(input())) h = list(map(int, input().split())) max = 0 tmp = 0 for i in range(n-1): if h[i] >= h [i+1]: tmp += 1 else: tmp = 0 if tmp > max: max = tmp print(max)
p02923
N = int(eval(input())) H = list(map(int, input().split())) max_count = 0 for i in range(0, N-1): tmp_count = 0 for j in range(i, N-1): if H[j] >= H[j+1]: tmp_count=tmp_count+1 else: break if tmp_count>max_count: max_count=tmp_count if max_count >= N-i: break print(max_c...
N = int(eval(input())) H = list(map(int, input().split())) tmp = 0 s = 0 for i in range(N-1): if H[i] >= H[i+1]: tmp += 1 s = max(s, tmp) else: tmp = 0 print(s)
p02923
import sys input = sys.stdin.readline # C - Lower n = int(eval(input())) h = list(map(int, input().split())) ans = 0 for i in range(n): count = 0 for j in range(i, n - 1): if h[j] >= h[j + 1]: count += 1 else: break ans = max(ans, count) # print('スタート:' + str(i), count) print(ans...
import sys input = sys.stdin.readline # C - Lower n = int(eval(input())) h = list(map(int, input().split())) count = 0 ans = 0 for i in range(n - 1): if h[i] >= h[i + 1]: count += 1 else: count = 0 ans = max(ans, count) print(ans)
p02923
N = int(eval(input())) H = list(map(int,input().split())) maxim = 0 for i in range(N-1): count = 0 for j in range(i,N-1): if H[j] >= H[j+1]: count += 1 else: break if count > maxim: maxim = count print(maxim)
N = int(eval(input())) H = list(map(int,input().split())) maxim = 0 count = 0 for i in range(N-1): if H[i] >= H[i+1]: count += 1 else: count = 0 if count > maxim: maxim = count print(maxim)
p02923
N = int(eval(input())) H = list(map(int, input().split())) cnt = [0] * N for i in range(N): for j in range(i, N-1): if H[j] >= H[j+1]: cnt[i] +=1 else: break print((max(cnt)))
N = int(eval(input())) H = list(map(int, input().split())) cnts = 0 cnt = [0] * N for i in range(1, N): if H[i-1] >= H[i]: cnts +=1 else : cnts = 0 cnt[i] = cnts print((max(cnt)))
p02923
n = int(eval(input())) h = list(map(int,input().split())) ans = 0 maxi = 0 for i in range(n-1): if h[i] >= h[i+1]: ans += 1 else: maxi = max(ans,maxi) ans = 0 print((max(maxi,ans)))
n = int(eval(input())) h = list(map(int,input().split())) ans = 0 maxi = 0 for i in range(1,n): if h[i-1] >= h[i]: ans += 1 else: maxi = max(ans,maxi) ans = 0 print((max(maxi,ans)))
p02923
n = int(eval(input())) h = list(map(int, input().split())) Max = 0 for start in range(n-1): count = 0 for i in range(start+1, n): if h[i] <= h[i-1]: count += 1 else: break Max = max(Max ,count) print(Max)
n = int(eval(input())) h = list(map(int, input().split())) Max = 0 start = 0 # cnt = 0 while start < n-1: # print(f"start = {start}") # cnt += 1 count = 0 for i in range(start+1, n): if h[i] <= h[i-1]: count += 1 else: break Max = max(Max ,coun...
p02923
import sys sys.setrecursionlimit(1000000000) n = int(eval(input())) h= list(map(int, input().split())) count = 0 ans = 0 def dfs(s): if s + 1 < len(h): if h[s] >= h[s+1]: global count count = count + 1 dfs(s+1) for i in range(len(h)): count ...
n = int(eval(input())) h= list(map(int, input().split())) count = 0 ans = 0 for i in range(len(h)): if i + 1 < len(h): if h[i] >= h[i+1]: count = count + 1 else: count = 0 if count > ans : ans = count print(ans)
p02923
n = int(eval(input())) h = list(map(int, input().split())) nm = len(h) ans = 0 for _ in range(nm): cnt = 0 while True: if len(h) == 1: break if h[0] >= h[1]: cnt += 1 h.pop(0) else: h.pop(0) break ans = max(an...
N = int(eval(input())) N_List = list(map(int,input().split())) ans = 0 cans = 0 for i in range(1,N): if N_List[i] <= N_List[i-1]: cans += 1 if cans > ans: ans = cans if N_List[i] > N_List[i-1]: cans = 0 print(ans)
p02923
N = int(eval(input())) data = list(map(int,input().split())) max_cnt = 0 for tmp_i in range(N-1): i = tmp_i cnt = 0 flag = True while flag: if i+1<N and data[i]>=data[i+1]: cnt += 1 i += 1 else: flag = False if max_cnt<cnt: ...
N = int(eval(input())) data = list(map(int,input().split())) i = 0 max_cnt = 0 while i<N-1: # i = tmp_i cnt = 0 flag = True while flag: if i+1<N and data[i]>=data[i+1]: cnt += 1 i += 1 else: flag = False i += 1 # tmp_i+...
p02923
N = int(eval(input())) H = [-1] + [int(h) for h in input().split()] max_count = 0 for n in range(1, N): count = 0 for m in range(n, N): if H[m] >= H[m+1]: count += 1 else: break max_count = max(max_count, count) print(max_count)
N = int(eval(input())) H = [-1] + [int(h) for h in input().split()] count = 0 max_count = 0 for n in range(1, N): if H[n] >= H[n+1]: count += 1 max_count = max(max_count, count) else: count = 0 print(max_count)
p02923
n = int(eval(input())) h_lst = list(map(int, input().split())) cnt = 0 res = 0 left = 0 for i, h1 in enumerate(h_lst): left = h1 while i <= len(h_lst)-2 and left >= h_lst[i+1]: cnt+=1 left = h_lst[i+1] i+=1 res = max(res, cnt) cnt = 0 print(res)
n = int(eval(input())) h_lst = list(map(int, input().split())) cnt = 0 res = 0 for i, left in enumerate(h_lst): if i <= len(h_lst)-2 and left >= h_lst[i+1]: cnt +=1 else: res = max(res, cnt) cnt = 0 print(res)
p02923
def count_descending(nums): if not nums: return 0 count = 1 previous = nums[0] for i in range(1, len(nums)): if previous < nums[i]: return count else: count += 1 previous = nums[i] return count def max_move(nums): s...
def count_descending(nums, start): if start >= len(nums): return 0 count = 1 previous = nums[start] for i in range(start + 1, len(nums)): if previous < nums[i]: return count else: count += 1 previous = nums[i] return count ...
p02923
def count_descending(nums, start): if start >= len(nums): return 0 count = 1 previous = nums[start] for i in range(start + 1, len(nums)): if previous < nums[i]: return count else: count += 1 previous = nums[i] return count ...
import itertools def count_chains(nums): it = iter(nums) try: previous = next(it) except StopIteration: return count = 1 for n in it: if previous < n: yield count count = 0 count += 1 previous = n yield count...
p02923
N = int(eval(input())) H = [int(s) for s in input().split()] l=0 for i in range(N): t_l=0 for j in range(i, N-1): if H[j] >= H[j+1]: t_l = t_l + 1 else: break if l < t_l: l = t_l i=i+t_l+1 print(l)
N = int(eval(input())) H = list(map(int, input().split())) l=0 t_l = 0 for i in range(N-1): if H[i] >= H[i+1]: t_l = t_l + 1 if l < t_l: l = t_l else: t_l=0 print(l)
p02923
N = int(eval(input())) H = [int(j) for j in input().split()] maximum = 0 i = 0 for i in range(N-1): cnt = 0 while H[i] >= H[i+1] and i < N-1: cnt+=1 i += 1 if maximum < cnt: maximum = cnt if i == N-1: break print(ma...
N = int(eval(input())) H = [int(j) for j in input().split()] maximum = 0 cnt = 0 for i in range(0,N-1): if H[i] >=H[i+1]: cnt+=1 if maximum < cnt: maximum = cnt else: cnt=0 print(maximum)
p02923
N=int(eval(input())) str_list = input().split(' ') H = [int(x) for x in str_list] max_count = 0 for ii in range(len(H)-1): count=0 while H[ii+count]>=H[ii+count+1]: count += 1 if ii+count>=len(H)-1: break if max_count < count: max_count = count print(max_count...
N=int(eval(input())) str_list = input().split(' ') H = [int(x) for x in str_list] max_count = 0 count=0 for ii in range(len(H)-1): if H[ii] >= H[ii+1]: count += 1 else: count = 0 if max_count < count: max_count = count #if max_count + ii > len(H): # break pri...
p02923
n = int(eval(input())) h = list(map(int, input().split())) h.reverse() ans = 0 value = 0 for i in range(1, n): if h[i-1] <= h[i]: value += 1 else: value = 0 ans = max(ans, value) print(ans)
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n = int(eval(input())) H = list(map(int, input().split())) res = 0 cnt = 0 for i in range(1, n): if H[i - 1] >= H[i]: cnt += 1 else: res = max(...
p02923
N = int(eval(input())) H = [int(x) for x in input().split()] ans = 0 for i in range(N): current = 0 if(N-i < ans): break while(True): if(i==N-1): break elif(H[i] >= H[i+1]): current += 1 i += 1 else: ...
N = int(eval(input())) H = [int(x) for x in input().split()] ans = 0 current = 0 for i in range(N): if(i == N-1): if(current > ans): ans = current break if(H[i] >= H[i+1]): current += 1 else: if(ans < current): ans = current cu...
p02923
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 i = 0 for i in range(N): tmp = 0 while i<N-1: if H[i]>=H[i+1]: tmp += 1 i += 1 else: break ans = max(tmp,ans) i += 1 print(ans)
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 i = 0 for k in range(N): tmp = 0 while i<N-1: if H[i]>=H[i+1]: tmp += 1 i += 1 else: break ans = max(tmp,ans) if i >= N-1: break i += 1 print(...
p02923
N = int(eval(input())) H = [int(x) for x in input().split()] diff = '' for i in range(1, len(H)): d = H[i] - H[i-1] if d <= 0: diff += '1' else: diff += '0' ans = max([len(s) for s in diff.split('0') ]) print(ans)
N = int(eval(input())) H = [int(x) for x in input().split()] dp = [0] * len(H) for i in range(1, len(H)): if H[i-1] >= H[i]: dp[i] = dp[i-1] + 1 ans = max(dp) print(ans)
p02923
N = int(eval(input())) H = [int(x) for x in input().split()] C = [0]*N for i in range(N): for j in range(i,N-1): if H[j] >= H[j+1]: C[i] += 1 else: break print((max(C)))
N = int(eval(input())) H = [int(x) for x in input().split()] m = 0 count = 0 for i in range(N-1): if H[i] >= H[i+1]: count += 1 else: count = 0 if count > m: m = count print(m)
p02923
n = int(eval(input())) h = list([int(x) for x in input().split(" ")]) ans = 0 for i in range(0,n): kari = 0 j = i while j<n-1 and h[j] >= h[j+1]: kari += 1 j += 1 if ans < kari: ans = kari if ans-1 >= n-i: break print(ans)
n = int(eval(input())) h = list([int(x) for x in input().split(" ")]) ans = 0 kari = 0 i = 0 for m in range(0,n-1): if h[m] >= h[m+1]: kari += 1 else: kari = 0 if ans < kari: ans = kari print(ans)
p02923
n = int(eval(input())) height = list(map(int, input().split())) result = 0 for i in range(n): kari = 0 for j in range(i, n-1): if height[j] >= height[j+1]: kari += 1 else: break if kari > result: result = kari print(result)
n = int(eval(input())) height = list(map(int, input().split())) top = [0] + [i+1 for i in range(n-1) if height[i] < height[i+1] ] result = [top[i+1]-top[i]-1 for i in range(len(top)-1)] + [(n-1)-top[len(top)-1]] print((max(result)))
p02923
N = int(eval(input())) H = list(map(int,input().split())) ans = 0 cnt = 0 start = 0 for i in range(N): if start > i: continue ans = max(ans,cnt) cnt = 0 for j in range(N-i-1): if H[i+j] >= H[i+j+1]: cnt += 1 if i+j+1 == N-1: print((ma...
N = int(eval(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(ans,cnt) cnt = 0 if i+2 == N: print((max(ans,cnt))) exit() print(ans)
p02923
n=int(eval(input())) h=list(map(int,input().split())) l=[] for i in range(n-1): if h[i+1]-h[i]<=0: l.append(1) else: l.append(0) ans=0 mn=0 for j in range(len(l)): if l[j]==0: ans=0 else: ans+=1 mn=max(ans,mn) print((max(mn,ans)))
n=int(eval(input())) h=list(map(int,input().split())) l=[] for i in range(n-1): if h[i+1]-h[i]<=0: l.append(1) else: l.append(0) ans=0 mn=0 for j in range(len(l)): if l[j]==0: ans=0 else: ans+=1 mn=max(ans,mn) print(mn)
p02923
n = int(eval(input())) h = list(map(int, input().split())) cnt = 0 cnt_tmp = 0 num = h[0] for i in range(1, n): if num >= h[i]: cnt_tmp += 1 num = h[i] else: num = h[i] cnt_tmp = 0 cnt = max(cnt, cnt_tmp) print(cnt)
n = int(eval(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 ans = max(cnt, ans) print(ans)
p02923
n = int(eval(input())) list_H = list(map(int, input().split())) list_result = [] # どこを選ぶか for i in range(n): result = 0 # その条件で何回移動可能かを調べる for j in range(i, n - 1): #移動可能かを調べる if list_H[j] >= list_H[j+1]: result = result + 1 else: break ...
n = int(eval(input())) list_H = list(map(int, input().split())) #右の数字よりもおっきいときに1,ちっさいときに0 list_H_01 = [] for i in range(n-1): if list_H[i] >= list_H[i+1]: list_H_01.append(1) else: list_H_01.append(0) count = 0 list_result=[] for i in list_H_01: if i == 0: ...
p02923
N = int(eval(input())) H = list(map(int, input().split())) H.reverse() ans = 0 cnt = 0 for i in range(1, N): if H[i] >= H[i - 1]: cnt += 1 else: ans = max(ans, cnt) cnt = 0 ans = max(ans, cnt) print(ans)
N = int(eval(input())) H = list(map(int, input().split())) ans = 0 cnt = 0 for i in range(1, N): if H[i] <= H[i - 1]: cnt += 1 else: ans = max(ans, cnt) cnt = 0 ans = max(ans, cnt) print(ans)
p02923
#139 N = int(eval(input())) H = list(map(int, input().split())) count = 0 count_new = 0 flag = 0 for i in range(N-1): if H[i] >= H[i + 1]: # print("i", i) count_new += 1 # print(count) if i == N - 2 and flag == 0: flag = 1 count = count_new ...
N = int(eval(input())) H = list(map(int, input().split())) count = 0 c_max = 0 for i in range(N-1): if H[i] >= H[i+1]: count += 1 else: if c_max < count: c_max = count count = 0 print((max(c_max, count)))
p02923
#!/usr/bin/env python3 import sys def solve(N: int, H: "List[int]"): result = 0 while len(H) >= 2: count = 0 for i in range(len(H) - 1): if H[i] >= H[i + 1]: count += 1 else: break result = max(result, count) ...
#!/usr/bin/env python3 import sys def solve(N: int, H: "List[int]"): result = 0 count = 0 for i in range(N - 1): if H[i] >= H[i + 1]: count += 1 else: result = max(result, count) count = 0 result = max(result, count) print(result)...
p02923
n=int(eval(input())) h = list(map(int,input().split())) saidai = 0 for i in range (n): count = 0 for j in range (n-i-1): if int(h[i+j])>=int(h[i+j+1]): count = count+1 else : i = i + j break saidai = max(saidai,count) print(saidai)
n=int(eval(input())) h = list(map(int,input().split())) m=0 count = 0 for i in range (n-1): if h[i]>=h[i+1]: count += 1 else: m = max(m,count) count = 0 m = max(m,count) print(m)
p02923