[20250904] PGM / LV3 / [1차] 셔틀버스 / 김수연 #814
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://school.programmers.co.kr/learn/courses/30/lessons/17678?language=java
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
셔틀이 09:00부터 총 n회 t분 간격으로 역에 도착하며, 하나의 셔틀에는 최대 m명의 승객이 탈 수 있을 때,
콘이 셔틀을 타고 사무실로 갈 수 있는 도착 시각 중 제일 늦은 시각 구하기
🔍 풀이 방법
구현
버스가 출발하는 시각을 저장해둔 배열을 만들고, 각 크루가 기다리기 시작한 시간을 저장한 배열을 만들고 오름차순으로 정렬
이후, 먼저 온 크루 순서대로 각 버스에 탈 수 있는지 여부를 저장하기
만약 버스의 크기가 꽉 찼으면 1분 전에 도착해야하므로
answer = crew - 1로 해주기
⏳ 회고
난 바보다ㅜ