Skip to content

체스판위의 공#85

Open
asqwklop12 wants to merge 1 commit intomainfrom
0302
Open

체스판위의 공#85
asqwklop12 wants to merge 1 commit intomainfrom
0302

Conversation

@asqwklop12
Copy link
Owner

유형: 브루트 포스 + dp
등급: 골드
url: https://www.acmicpc.net/problem/16957

개 빡세다.~

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9586080e5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +102 to +103
memoX[x][y] = currX;
memoY[x][y] = currY;

Choose a reason for hiding this comment

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

P1 Badge Memoize all traversed nodes to avoid quadratic runtime

findDest only stores the destination for the original (x, y) call site, so intermediate cells on the same descent path are recomputed from scratch when visited later. On inputs where many starts follow long chains before reaching a sink (common at this problem’s 500x500 limit), this turns the solver into roughly O((R*C)^2) neighbor scans and can time out even though path compression is expected here. Cache the destination for every cell visited during the while-walk, not just the first one.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant