이연주 : boj 18352 특정 거리의 도시 찾기 #242
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.
🅰 설계
1. 도시 간 관계
도시 간 관계는 양방향이 아니라 단방향 관계이다
2. 전체 도시 탐방
주어진 최소 거리만큼 떨어진 도시가 있는지 확인
3. 결과 도출
isThere
: 주어진 최소거리만큼 떨어진 도시가 있다면 true가 되는 변수isThere이 true가 아니면 주어진 최소거리만큼 떨어진 도시가 없다는 것으로 -1을 출력한다. 그 반대이면 주어진 최소거리만큼 떨어진 도시를 StringBuilder에 추가한다.
✅ 후기