이전 첨탑이 다음의 첨탑 높이보다 더 높은 경우에 다음 첨탑만 같이 쓰러지고 다다음 첨탑은 관계가 없다.
import sys
input = sys.stdin.readline
n =int(input())
arr= list(map(int, input().split()))
# i = 0
cnt =1
tall = arr[0]
for i in range(1, len(arr)):
if arr[i-1]> arr[i] :
cnt +=0
else :
cnt +=1
print(cnt)
'알고리즘 문제풀이' 카테고리의 다른 글
ZOAC2 (백준18238) (0) | 2023.09.13 |
---|---|
피로도(백준 22864) (0) | 2023.09.12 |
가장 많은 글자(백준 1371) (1) | 2023.09.09 |
등산 (16681 백준) (0) | 2023.09.07 |
근손실(백준18429) (0) | 2023.09.06 |