Skip to content

Conversation

@Seol-JY
Copy link
Contributor

@Seol-JY Seol-JY commented Oct 13, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/2504

🧭 풀이 시간

20분

👀 체감 난이도

✏️ 문제 설명

괄호열의 값을 계산하는 문제 () = 2, [] = 3이고, (X) = 2×X, [X] = 3×X로 계산함. 연속된 괄호는 덧셈, 올바르지 않은 괄호열은 0 출력

🔍 풀이 방법

ArrayDeque로 괄호 검증하면서 동시에 값 계산
여는 괄호 만나면 temp에 곱셈, 닫는 괄호 만나면 직전이 여는 괄호인 경우에만 temp를 result에 누적하고 temp를 나눔
스택으로 괄호 쌍 검증

⏳ 회고

스택 + 곱셈 누적 방식으로 풀이함 ez

@Seol-JY Seol-JY added the success 👍 해설을 보지 않고 풀었을 때 label Oct 13, 2025
@ShinHeeEul ShinHeeEul merged commit eb2d906 into main Oct 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants