Skip to content

Conversation

@03do-new30
Copy link
Contributor

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

  • 문자열이 폭발 문자열을 포함하고 있는 경우에, 모든 폭발 문자열이 폭발
  • 폭발 이후 남은 문자들을 이어붙여 새로운 문자열을 만듦
  • 새로운 문자열에 폭발 문자열이 있다면 폭발이 다시 일어날 수 있음
  • 남은 문자열은?

🔍 풀이 방법

  • 문자를 stack에 쌓아가면서 폭발 문자열이 의심되는 경우 pop하면서 검사

⏳ 회고

  • 처음에는 replaceAll로 풀었는데 메모리 초과가 났다.
  • replaceAll은 내부적으로 새로운 문자열을 계속 만들어야 하므로 속도도 느리고, 메모리 초과가 난다고 한다.
  • 스택을 쓴다는 걸 잘 떠올리지 못하는 경우가 많은 것 같다.

@03do-new30 03do-new30 added success 👍 해설을 보지 않고 풀었을 때 hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 labels Jul 17, 2025
@ShinHeeEul ShinHeeEul merged commit cf8affd into main Jul 17, 2025
1 check passed
@03do-new30 03do-new30 removed the success 👍 해설을 보지 않고 풀었을 때 label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants