[Baekjoon-13549] yein #167
Open
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.
BFS로 풀 수 있었습니다!
<바이러스> 문제 풀었던 거...를 조금 참고해서 풀었습니다.
scores 배열을 업데이트 해 주는 데 조건을 잘못 생각해서 헤맸고,
수빈이가 동생보다 앞서 있는 경우를 미처 생각하지 못해서 또 헤매긴 했지만...
0-1 BFS 은 미처 몰랐는데요...
그래프 문제를 풀 때 간선 가중치가 0 또는 1인 경우에 사용하며, 간선 가중치가 0일 때는 가장 먼저 pop되는 위치에 appendleft(), 간선 가중치가 1일 때는 맨 뒤에 append() 해 주어서 탐색을 진행하는 풀이라고 합니다
append만 쓰는 방식보다는 훨씬 효율적이고 반복 계산을 줄일 수 있을 것 같습니다!