Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

[2023-09-13] jisu #206#224

Merged
zsmalla merged 1 commit into
mainfrom
jisu-#206
Sep 14, 2023
Merged

[2023-09-13] jisu #206#224
zsmalla merged 1 commit into
mainfrom
jisu-#206

Conversation

@zsmalla
Copy link
Copy Markdown
Contributor

@zsmalla zsmalla commented Sep 13, 2023

PR Summary

풀이 시작 : 2023-09-11 14:20

제한 조건

  • 주어지는 식의 길이는 최대 50

풀이 방법

  • 연산자는 '+' 아니면 '-'
  • 맨 앞에 -가 오는 경우는 없으므로 여는 괄호는 연산자 뒤, 닫는 괄호는 다음 연산자 앞에 올 수 있음
  • 최소 값을 만들기 위해 '-' 다음에 오는 구간을 최대로 만들어줘야 함
    • '-'연산자 뒤에 괄호를 열고 다음 '-'가 나오기 전에 괄호를 닫으면 '-' 구간을 최대로 묶을 수 있음
    • 55-50+40-10+20+30+40 -> 55-(50+40)-(10+20+30+40)
      풀이 완료 : 2023-09-11 14:58 (풀이 시간 : 38분)

ISSUE NUMBER

@zsmalla zsmalla added the BOJ label Sep 13, 2023
@zsmalla zsmalla self-assigned this Sep 13, 2023
Copy link
Copy Markdown
Member

@Woo-Yeol Woo-Yeol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체 수식에 실제 bracket을 넣어서 식을 만드신 후에 eval을 통해 연산 결과를 확인해주시는 내용들이 시뮬레이션과 같다고 느껴져서 대단하다고 느꼈습니다. 고생하셨습니다!

Comment thread BOJ/잃어버린 괄호/jisu.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 맨 처음 문제 풀 때 eval을 사용해서 풀었던 기억이 있는데..🙃
지수님 풀이 방식도 직관적으로 이해가 갔어요! 고생하셨습니다👍👍 나중에 코테에 얼마든지 비슷한 구현 문제가 나올 수 있을 것 같아요!

@ksumini ksumini linked an issue Sep 14, 2023 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@limstonestone limstonestone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eval 함수로 날먹(?)하는 문제를 지수님과 함께 풀었던 기억이 있는데 저는 떠올리지 못했네요 ㅋㅋㅋ
직관적으로 문제에서 주어진대로 잘 풀어내신 것 같습니다!
리마인드 시켜주셔서 감사합니다 지수님!

@zsmalla zsmalla merged commit bc1927f into main Sep 14, 2023
@zsmalla zsmalla deleted the jisu-#206 branch September 14, 2023 13:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOJ] 잃어버린 괄호

4 participants