-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서는 조건 만족 여부를 따로 빼진 않으셨군요 😂 사실 만족 여부가 간단해서 이 구조도 보기에 깔끔해서 전혀 이해가 어렵지 않았습니다! 고생하셨습니다 수민님!
mid = (left+right) // 2 # 정수 상한액 | ||
tot = 0 # 배정한 예산의 총합 | ||
for city in cities: | ||
if city > mid: # 1) 상한액 이상의 예산 요청을 한 경우 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피드백 드릴게 이런 거 밖에 없지만.. 파이썬으로 코테 볼때는 pythonic하게 짜는 것도 중요하다고 한 것 같아서 이런 부분은 tot += mid if city > mid else city
이런 식으로 짜려고 노력하는 편입니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 의견인것 같습니다 지수님!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조건대로 짜고 최적화를 안해서 그런가봐요😂 담부턴 좀 더 파이써닉하게 최적화하겠습니당 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대체적인 풀이 내용이 유사하여 큰 피드백은 없습니다. 다만 마지막 right를 반환하는 부분이 지수님의 풀이와 유사하여서 지수님께 질문을 남겼었는데 다시 한 번 천천히 생각해보니 최대 값을 찾기 위해서 right를 반환하는 방법이 효율적일 것 같다는 것을 깨달았네요! 감사합니다 수민님!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다람쥐!!
문제 설명도 잘해주셔서 감사합니당 ㅎ
mid = (left+right) // 2 # 정수 상한액 | ||
tot = 0 # 배정한 예산의 총합 | ||
for city in cities: | ||
if city > mid: # 1) 상한액 이상의 예산 요청을 한 경우 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 의견인것 같습니다 지수님!!!
PR Summary
풀이시간 : 20분
<input>
<solution>
<시간복잡도>
O(nlogn)