728x90
https://www.acmicpc.net/problem/1668
1668번: 트로피 진열
민식이는 “오민식”이라는 팀이름으로 수없이 많은 로봇대회를 우승했다. 따라서 민식이의 집에는 트로피가 많다. 민식이는 트로피를 어떤 선반 위에 올려놨다. 이 선반은 민식이의 방문을 열
www.acmicpc.net
손 풀 겸 쉬운 브론즈 문제
# import sys; input = sys.stdin.readline
def main():
N = int(input())
tropy = [int(input()) for _ in range(N)]
ans = ''
max_h, ret = 0, 0
for i in range(len(tropy)):
if max_h < tropy[i]:
max_h = tropy[i]
ret += 1
ans += str(ret)+'\n'
max_h, ret = 0, 0
for i in range(len(tropy)-1,-1,-1):
if max_h < tropy[i]:
max_h = tropy[i]
ret += 1
ans += str(ret)
print(ans)
if __name__ == "__main__":
main()
'STUDY > Algorithm' 카테고리의 다른 글
[백준] 9489 사촌 python (0) | 2022.01.11 |
---|---|
[백준] 20365 블로그 2 python (0) | 2022.01.11 |
[백준] 1956 운동 python(pypy) (0) | 2022.01.10 |
[백준]11401 이항 계수 3, python (0) | 2022.01.09 |
[백준] 14284 간선 이어가기 2, python, C++ (0) | 2022.01.08 |