14659. 한조서열정리하고옴ㅋㅋ

멍진이·2021년 7월 2일
0

백준 문제풀기

목록 보기
28/36

문제 코드

man = int(input())

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

max_count = 0
now_count = 0
start_man = num_list[0]
for i in range(1,man):
    if start_man < num_list[i]:
        if max_count < now_count:
            max_count = now_count
        now_count = 0
        start_man = num_list[i]
    else:
        now_count+=1

if now_count > max_count:
    max_count = now_count
print(max_count)

문제 풀이

  • 현재값보다 낮은 값이 많은 것들을 찾아나가는 간단한 문제
profile
개발하는 멍멍이

0개의 댓글