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

[2023-09-20] dohyun #238#256

Merged
limstonestone merged 1 commit into
mainfrom
dohyun-#238
Sep 21, 2023
Merged

[2023-09-20] dohyun #238#256
limstonestone merged 1 commit into
mainfrom
dohyun-#238

Conversation

@limstonestone
Copy link
Copy Markdown
Contributor

PR Summary

풀이시간

  • 약 1시간 풀이 후 실패로 답지 참조

접근법

  • N 10만 이하 -> O(NlogN)
  • 그리디? -> 현재 행에서 최대라고 해서 합이 최대가 되는게 아니기 때문에 X
  • 열은 왜 4개로 고정? -> 각 열별로 결과를 저장해놓으면 될듯
  • 현재 열을 제외한 이전 행의 최대값과 현재 열의 값을 계속해서 더해가며 갱신하면 될듯

회고

  • 로직은 같은데 1차원 배열로만 해결하려다가 사고가 멈춰버린듯함 ㅠㅠ
    • DP테이블은 2차원 배열도 가능하다는거 꼭 인지하기

ISSUE NUMBER

@limstonestone limstonestone self-assigned this Sep 20, 2023
@limstonestone limstonestone linked an issue Sep 20, 2023 that may be closed by this pull request
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.

DP 문제들이 한 번에 솔루션이 안떠오르면 너무 힘들어지는 것 같아요 ㅠㅠ 고생하셨습니다 도현님!

Comment thread Programmers/땅따먹기/dohyun.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

아 저도 이렇게 접근을 하다가 land[i][j]를 업데이트 하는 것이 더 좋겠다는 생각을 했었습니다! 고생하셨어요 도현님!

Comment thread Programmers/땅따먹기/dohyun.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.

dp 배열을 굳이 만들 필요없이 어차피 아래로 내려가는 구조니까 land배열을 그대로 사용하면 메모리 사용량을 줄일 수 있어요!!

Copy link
Copy Markdown
Contributor

@zsmalla zsmalla left a comment

Choose a reason for hiding this comment

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

접근법은 잘 떠올리셨는데 아쉽네요 ㅠㅠ 참고하신 풀이도 메모리 측면에서 조금의 최적화가 가능하니 다음에 한 번 다시 도전해보시죠! 고생하셨습니다 도현님!

@limstonestone limstonestone merged commit 2c9061b into main Sep 21, 2023
@limstonestone limstonestone deleted the dohyun-#238 branch September 21, 2023 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Programmers] 땅따먹기

4 participants