본문 바로가기
Beakjoon&프로그래머스/Java

[백준/파이썬] 1668번 트로피 진열

by 현장 2022. 4. 16.

-Code

n = int(input())
tropys = [int(input()) for _ in range(n)]
cnt1, cnt2 = 0, 0
tropy1, tropy2 = 0, 0
for i in tropys:
    if tropy1 < i:
        cnt1 += 1
        tropy1 = i

for i in tropys[::-1]:
    if tropy2 < i:
        cnt2 += 1
        tropy2 = i

print(cnt1)
print(cnt2)