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.
๐ฑWIL
BFS+๊ตฌํ๋ฌธ์ ๋ฅผ ํ์๊ณ , ๋ค๋ฅธ ๋ฌธ์ ๋ก๋ java๋ก ํ ์ ํ ๋ฌธ์ ๋ฅผ ํ์ดํด๋ณด์๋ค. BFS ๊ตฌํ ๋ฌธ์ ์ ๊ฒฝ์ฐ, ํฐ ํ์ ๋ค ๋์ผํ ๊ฒ ๊ฐ๋ค. ๋ค๋ง ๋ฐฉํฅ์ด๋ผ๊ฑฐ๋, ๋งต์ด ์ด๋ํ๋ค๊ฑฐ๋ ์ถ๊ฐ์ ์ธ ์กฐ๊ฑด์ ๋ค๋ฃจ๋ ๊ฒ์ด ์ด๋ ค์ด ๋ถ๋ถ์ธ ๊ฒ ๊ฐ๋ค.#16509 ์ฅ๊ตฐ ๋ฌธ์ ๋ ๋ฐฉํฅ์ด 8๊ฐ์ง๋ ๋์ด ์ด๋ํ๋ ๊ฑธ ๊ณ ๋ คํ๋ ๊ฒ์ด ๊ฐ์ฅ ํท๊ฐ๋ ธ๋ ๋ถ๋ถ์ด์๋ค.#11559. Puyo Puyo๋ ์ค๋ ฅ์ ์ฒ๋ฆฌํ๋ ๋ถ๋ถ์ด ๋ง๋งํ๋ค. Puyo๊ฐ ํฐ์ง๊ฒ ๋๋ฉด ๋ฐ์ผ๋ก ๋ด๋ ค์ค๋๋ก ํ๊ธฐ ์ํด์ ๋ฐ๋ณต์ ์ผ๋ก ๊ตํํ๋ฉฐ ํ์ดํ๋ ๋ถ๋ถ์ด ์ธ์์ ์ด์๋ค. ๋์ ๊ฒฝ์ฐ, ์ด ๋ถ๋ถ์์ ๋งํ์ ๋ค๋ฅธ ๋ถ๋ค์ ์ ๋ต์ ๋ณด๊ณ ํ์ด๋ฅผ ์ด์ด๊ฐ๊ฒ ๋์๋ค.ํ๋ก๊ทธ๋๋จธ์ค ๊ณ ๋์ kit - ๋ ๋งต๊ฒ๋ฌธ์ ์ ๊ฒฝ์ฐ, Java์์Heap์ ๊ตฌํํ๊ธฐ ์ํด์๋PriorityQueue๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค๋ ๊ฒ์ ์๊ฒ ๋์๋ค.๐์ฃผ๊ฐ ๋ชฉํ ๋ฌธ์ ์: 3๊ฐ
๋ฐฑ์ค #16509. ์ฅ๊ตฐ: ๊ทธ๋ํ / ๊ณจ๋5
์ ๋ฆฌํ ๋งํฌ: (๋ฐ๋ก๊ฐ๊ธฐ)
๐ฉํ๋ก์ฐ (์ ํ)
๐ฉ์ ์ถํ ์ฝ๋
๐กTIL
๋ฐฑ์ค #11559. Puyo Puyo: ๊ทธ๋ํ / ๊ณจ๋4
์ ๋ฆฌํ ๋งํฌ: (๋ฐ๋ก๊ฐ๊ธฐ)
๐ฉํ๋ก์ฐ (์ ํ)
visited๋ฐฐ์ด์ ์ด๊ธฐํํ๋ค.pang = True๋ก ์ค์ ํ๋ค.pang์ด ์ฐธ์ด๋ฉด ๋ธ๋ก์ ์๋๋ก ๋ด๋ฆฌ๊ณcombo += 1๐ฉ์ ์ถํ ์ฝ๋
๐กTIL
down()ํจ์์์ ์์์ ์๋๋ก ๋ด๋ ค์ค๋๋ก ๋ฐ๋ณต์ ์ผ๋ก ๊ตํํ๋ ๋ฐฉ์์ด ์ธ์ ๊น์๋ค.ํ๋ก๊ทธ๋๋จธ์ค #42626. ๋๋งต๊ฒ: ํ / Level2
์ ๋ฆฌํ ๋งํฌ: (๋ฐ๋ก๊ฐ๊ธฐ)
๐ฉํ๋ก์ฐ (์ ํ)
while๋ฌธ์ ํตํด:1๋ฐํ.๐ฉ์ ์ถํ ์ฝ๋
๐กTIL
deque๋ฅผ ์ด์ฉํ์ฌ ์ฝ๊ฒ ๊ตฌํํ ์ ์๋ ๋ถ๋ถ์ Java๋ก ์ ๊ทผํ๋ ์ด๋ค ํ๋ ์์ํฌ๋ฅผ ์จ์ผ ํ ์ง ๊ฐ์ด ์ค์ง ์์๋ค.Java Heap์ด๋ผ๊ณ ๊ฒ์ํ๋ โPriorityQueueโ ์ปฌ๋ ์ ์ด ๋์ค๊ฒ ๋์๋ค. ์ด ์๋ฃ๊ตฌ์กฐ๋ฅผ ํ์ฉํ์ฌ ํ์ดํ๋ ์ฝ๊ฒ ์ ๊ทผํ ์ ์์๋ค.PriorityQueue์๋ฃํ์์ ์ฌ์ฉํ๋ ์์๋offer,peek,poll์ด ์๋ค.PriorityQueue๋ฅผ ์จ์ผ๋ง ํ๋ ์ ํ์ด์๋ค.