Open
Conversation
- 100 ms - Knapsack - 각 기업별, 투자 액수별 DP 수행 - 새로운 이익 계산 시 이전 기업까지의 결과만 참조 - 이익 크기 비교는 현재까지의 결과에서 비교 - 이익이 업데이트 되면 해당 위치에 마지막 투자 액수 저장 - 최대 이익 출력 후 마지막 투자 액수를 거꾸로 따라가면서 - 각 기업에 투자한 액수 추적
- 84 ms - 그리디 - 시작 열에 장애물이 두 개면 완주 불가 - K > 1 이고, 시작 열과 도착 열에 - 대각으로 장애물이 있으면 완주 불가 - 첫 장애물 위치의 반대 차선으로 시작점 결정 - 첫 장애물 옆까지 직진 - 현재 차선 앞에 장애물이 없으면 직진 - 현재 차선 앞에 장애물이 존재하면 - 차선 변경할 위치, 이후 직진할 위치 중 장애물이 없으면 - 차선 변경 후 직진 - 둘 중 하나라도 장애물이 존재하면 완주 불가 - 도착 지점 차선과 시작 지점 차선이 같으면 - 직진하여 다음 샘플 주행 트랙으로 이동 - 도착 지점 차선과 시작 지점 차선이 다르면 - 직진 후 차선 변경 혹은 차선 변경 후 직진 - (샘플 주행 트랙 이동 * K) - + (트랙간 이동 * (K - 1)) 출력
- 304 ms - 투 포인터 - 헤어 에센스 3 개를 합치면 항상 가득 참 - 1 개로 이미 가득 찬 헤어에센스 수 - + 2 개로 교환하여 가득 채울 수 있는 경우의 수 - + 나머지 헤어에센스 / 3 - 헤어에센스 정렬 후 뒤에서부터 가득 찬 헤어에센스 제외 - 투 포인터 : 2 개로 교환하여 가득 채울 수 있는 경우의 수 계산 - left 와 right 로 가득 채울 수 있으면 left 증가 right 감소 - 가득 채울 수 없으면 left 만 증가
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.
문제명 :
기업투자1. 풀이 과정
문제명 :
현대모비스 자율 주행 테스팅 11. 풀이 과정
문제명 :
재활용 캠페인1. 풀이 과정