난 쓰레기야 - #97
Open
protectHeo wants to merge 3 commits into
Open
난 쓰레기야#97protectHeo wants to merge 3 commits into
protectHeo wants to merge 3 commits into
Conversation
DGJSKIM
approved these changes
Apr 29, 2025
Contributor
There was a problem hiding this comment.
이 친구도 저랑 풀이가 비슷해서 크게 어쩌구는 없습니다
Comment on lines
+50
to
+56
| @Override | ||
| public int compareTo(Location o) { | ||
| return o.moved - moved; | ||
| } | ||
| } | ||
|
|
||
| public static void main(String[] args){ |
Contributor
There was a problem hiding this comment.
뭐 답이 안나온다 하셨지 않았나요 몇번인지 적어주시면 감사🐱🚀
Comment on lines
+50
to
+53
| @Override | ||
| public int compareTo(Location o) { | ||
| return o.moved - moved; | ||
| } |
Contributor
There was a problem hiding this comment.
move 기준으로 우선순위 박으신 이유가 있나요? 전 그냥 큰 의미 없는 거 같아서 뺐었는데
anjungin
reviewed
Apr 29, 2025
Comment on lines
+25
to
+48
| if(location.x == board.length - 1 && location.y == board[0].length - 1) { | ||
| answer = Math.min(answer, location.changed); | ||
| continue; | ||
| } | ||
|
|
||
| for(int i = 0 ; i < direction.length ; i++) { | ||
| int x = location.x + direction[i][0]; | ||
| int y = location.y + direction[i][1]; | ||
|
|
||
| //범위내인지 체크 | ||
| if(x >= 0 && x < board.length && | ||
| y >= 0 && y < board[0].length) { | ||
| Location nextLocation = new Location(x, y, location.changed); | ||
| //방향 바꿨는지 체크 | ||
| if(board[location.x][location.y] != i+1) { | ||
| nextLocation.changed++; | ||
| } | ||
|
|
||
| if(cost[x][y] > nextLocation.changed) { | ||
| cost[x][y] = nextLocation.changed; | ||
| queue.add(nextLocation); | ||
| } | ||
| } | ||
| } |
Collaborator
|
잘보감 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.