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.
๐ ๋ฌธ์ ๋งํฌ
[BOJ] DFS์ BFS https://www.acmicpc.net/problem/1260
โ๏ธ ์์๋ ์๊ฐ
40min
โจ ์๋ ์ฝ๋
DFS์ BFS ๊ธฐ์ด๋ถํฐ ๊ณต๋ถํด๋ณด๋ ค๊ณ ๊ธฐ๋ณธ์ ์ธ ๋ฌธ์ ๋ฅผ ๊ฐ์ ธ์์ต๋๋ค.
๊ทธ๋ฌ๋ฏ๋ก ๋ฐ๋ก ์๋ ์ฝ๋๊ฐ ์์ด๋ ์ดํดํ์ค ๊ฒ ๊ฐ์ต๋๋ค.
์ ๋ ๊ท์ฐฎ์์๊ฐ ์๋๋๋ค.
๐ ์๋กญ๊ฒ ์๊ฒ๋ ๋ด์ฉ
ํด๋น ๋ฌธ์ ์์๋
๋ฐฉ๋ฌธํ ์ ์๋ ์ ์ ์ด ์ฌ๋ฌ ๊ฐ์ธ ๊ฒฝ์ฐ์๋ ์ ์ ๋ฒํธ๊ฐ ์์ ๊ฒ์ ๋จผ์ ๋ฐฉ๋ฌธ
์ด๋ผ๋ ์กฐ๊ฑด์ด ์์ต๋๋ค.๊ทธ๋ฌ๋ฏ๋ก 2์ฐจ์ ๋ฆฌ์คํธ ์์๋ค์ ๋ฆฌ์คํธ๋ฅผ ์ ๋ ฌํด์ฃผ์ด์ผ ํฉ๋๋ค.
์ด๋ ์๋ฐ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ ๊ณตํ๋
Collections
๋ฅผ ์ฌ์ฉํ์ฌ ์ ๋ ฌํ์์ต๋๋ค.Collections๋ List, Map ๊ณผ ๊ฐ์ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ํจ์จ์ ์ผ๋ก ๋ค๋ฃฐ ์ ์๋ ๋ฉ์๋๋ฅผ ํฌํจํ๊ณ ์์ต๋๋ค.
์ ๋ ฌํ๋
.sort()
์ต๋/์ต์๊ฐ์ ์ฐพ๋
.max() / .min()
ํน์ ๊ฐ์ผ๋ก ๋ชจ๋ ์์๋ฅผ ์ฑ์ฐ๋
.fill()
๋ฑ์ด ์์ต๋๋ค.