[알고리즘/백준] 10824: 네 수(python)

유현민·2022년 4월 6일
0

알고리즘

목록 보기
106/253

자료구조를 이용해서 풀었다...

from collections import deque

a = deque(input().split())
for i in range(2):
    n1 = a.popleft()
    n2 = a.popleft()
    a.append(n1 + n2)

print(int(a.pop()) + int(a.pop()))
profile
smilegate megaport infra

0개의 댓글