여름의 서재

[백준] 1541_잃어버린 괄호 본문

알고리즘/BOJ

[백준] 1541_잃어버린 괄호

엉아_ 2021. 8. 12. 01:16
728x90
a = input().split('-')
count = 0

lst = list(map(int,a[0].split('+')))
count += sum(lst)

for i in a[1:]:
    lst = list(map(int,i.split('+')))
    count -= sum(lst)
print(count)

'알고리즘 > BOJ' 카테고리의 다른 글

[백준] 1874_스택 수열  (0) 2021.08.12
[백준] 1654_랜선 자르기  (0) 2021.08.12
[백준] 1018_체스판 다시 칠하기  (0) 2021.08.12
[백준] 17413_단어 뒤집기 2  (0) 2021.08.11
[백준] 1966_프린터 큐  (0) 2021.08.11
Comments