[20250815] BOJ / G1 / 낚시왕 / 이준희 #668
Merged
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.
🧷 문제 링크
https://www.acmicpc.net/problem/17143
🧭 풀이 시간
100분
👀 체감 난이도
✏️ 문제 설명
속도, 방향, 크기가 존재하는 상어가 수조에 있고 낚시 왕이 있습니다.
각 시간마다
낚시왕이 한칸 오른쪽 열로 이동 후 가장 가까운 상어를 낚음
상어가 이동함, 이동이 끝난 후 칸이 겹치면 더 큰 상어가 작은 상어를 먹음
을 반복할 때, 낚시왕이 끝에 다다랐을 때 낚은 상어 무게의 총합을 구하는 문제입니다.
🔍 풀이 방법
문제에 제시된 프로세스를 구현했습니다.
낚시꾼을 이동시킨 후, 가장 가까운 행의 상어를 잡아서 flag를 바꾸어 잡힘 표시를 했습니다.
각 시행마다 이동 후 상어끼리의 충돌처리를 했습니다.
⏳ 회고
1학기때의 원자 어쩌구 문제가 생각나는 문제였습니다.
그래도 이 문제는 중간에 충돌처리 하는 부분은 없어서 수월했던 것 같습니다.
원래 그래프이동 문제를 풀 때 방향벡터를 이중배열로 사용하고 y와 x 를 사용했었는데
대부분 row, column 과 각 열과 행의 방향벡터를 주로 사용하는 것 같아서 따라해봤습니다.