[20250904] BOJ / G5 / 컨베이어 벨트 위의 로봇 / 이준희 #813
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/20055
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
길이가 n인 컨베이어벨트에 길이가 2n인 벨트가 끼워져서 돌고 있고
컨베이어 벨트의 상단부의 1번칸이 '로봇을 올리는 위치'
n번칸이 '로봇을 내리는 위치' 라고 합니다.
벨트에는 내구도가 있으며 로봇을 올리거나 로봇이 이동할 때마다 내구도가 1씩 감소합니다.
내구도가 0인 곳에는 로봇을 올리거나 이동시킬 수 없습니다.
각 시간마다 아래의 절차가 진행됩니다.
종료 되었을 시점의 시간을 출력하는 문제입니다.
🔍 풀이 방법
내구도 배열과 로봇이 있는지 판단하는 배열을 사용해서 풀었습니다.
각 단계별로 로직을 구현했습니다.
⏳ 회고
처음에는 큐를 이용해서 맨뒤에서 빼서 앞으로 넣는 식으로 구현하려 했는데 구현이 복잡하고 중간 부분의 로직을 구현할 수 없어서 처음부터 생각하느라 어려웠던 것 같습니다.