백준 10773번
2022. 8. 23. 10:26ㆍ코딩
def solve():
n = int(input())
arr = []
for _ in range(n):
a = int(input())
if a != 0:
arr.append(a)
else:
arr.pop()
print(sum(arr))
solve()
https://roamingman.tistory.com/47
이번에도 로밍맨님의 도움을 받았습니다. 감사합니다!
'코딩' 카테고리의 다른 글
백준 12865번 문제(평범한 배낭) 파이썬(Python) 풀이(배우는 단계) (0) | 2022.08.23 |
---|---|
백준 1463번 (0) | 2022.08.23 |
백준 2579번 (0) | 2022.08.23 |
다익스트라 알고리즘 (0) | 2022.08.19 |
플로이드 워셜 알고리즘 (0) | 2022.08.19 |